using the code below (our friends from Rolla!), i'm having trouble sending emails from an asp.net web page. is there anything i need to specify / declare, smtpserver?
the code is working, and the asp.net page is completing without errors - but no email is being received.
many thanks,
JC
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
'Set the properties
objMM.From = "randomemail@domain.com"
objMM.To = "myemail@domain.com"
'If you want to CC this email to someone else...
'objMM.Cc = "someone2@someaddress.com"
'If you want to BCC this email to someone else...
'objMM.Bcc = "someoneElse@someaddress.com"
'Send the email in text format
objMM.BodyFormat = MailFormat.Html
'(to send HTML format, change MailFormat.Text to MailFormat.Html)
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.High
'Set the subject
objMM.Subject = "Celebrationsites Web Site Enquiry"
'Set the body - use VbCrLf to insert a carriage return
objMM.Body = strBody
'strBody being a variable containing message
'Specify to use the default Smtp Server
SmtpMail.SmtpServer = "localhost"
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(objMM)


Reply With Quote

Bookmarks