G
Guest
I found this code of the internet that should create a mail message:
'Create an instance of the MailMessage class
Dim objMM As New MailMessage
'Set the properties
objMM.To = "(e-mail address removed)"
objMM.From = "(e-mail address removed)"
'If you want to CC this email to someone else...
' objMM.Cc = "(e-mail address removed)"
'If you want to BCC this email to someone else...
' objMM.Bcc = "(e-mail address removed)"
'Send the email in text format
objMM.BodyFormat = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html)
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.Normal
'Set the subject
objMM.Subject = "MetaLabels Trial Version"
'Set the body - use VbCrLf to insert a carriage return
objMM.Body = "Hi!" & vbCrLf & vbCrLf & "How are you doing?"
'Now, to send the message, use the Send method of the SmtpMail
class
SmtpMail.Send(objMM)
This seems to work, I get no error message, but the mail is not sent.
Please advise, if you can.
'Create an instance of the MailMessage class
Dim objMM As New MailMessage
'Set the properties
objMM.To = "(e-mail address removed)"
objMM.From = "(e-mail address removed)"
'If you want to CC this email to someone else...
' objMM.Cc = "(e-mail address removed)"
'If you want to BCC this email to someone else...
' objMM.Bcc = "(e-mail address removed)"
'Send the email in text format
objMM.BodyFormat = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html)
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.Normal
'Set the subject
objMM.Subject = "MetaLabels Trial Version"
'Set the body - use VbCrLf to insert a carriage return
objMM.Body = "Hi!" & vbCrLf & vbCrLf & "How are you doing?"
'Now, to send the message, use the Send method of the SmtpMail
class
SmtpMail.Send(objMM)
This seems to work, I get no error message, but the mail is not sent.
Please advise, if you can.