Mike Bailey
Well-known member
I
Dim objEmailMessage As System.Web.Mail.MailMessage
Dim objSMTPServer As System.Web.Mail.SmtpMail
objEmailMessage = New System.Web.Mail.MailMessage
With objEmailMessage
.To = "me@mydomain.com"
.From = "bill.gates@microsoft.com"
.Subject = "Great Job!"
.Body = "Want all my money?"
End With
objSMTPServer.Send(objEmailMessage)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objEmailMessage As System.Web.Mail.MailMessage
Dim objSMTPServer As System.Web.Mail.SmtpMail
objEmailMessage = New System.Web.Mail.MailMessage
With objEmailMessage
.To = txtToEmail.Text
.From = txtFrom.Text
.Subject = "Great Job!"
.Body = "Want all my money?"
End With
[color=red] objSMTPServer.Send(objEmailMessage)[/color]
End Sub
End Class
An unhandled exception of type System.Web.HttpException occurred in system.web.dll
Additional information: Could not access CDO.Message object.