G
Guest
I am trying to get some help on how to send email via a remote smtp server. I
have posted here several times already. I need to be able to send email using
winforms, vb.net 2003 or 2005 through a remote smtp server. The server is
hosted by Web.com and I have talked to them but their support is NO HELP at
all.
I keep getting the error: Could not access 'CDO.Message' object
Here is the code that I am using:
Public Sub sendEmail(ByVal hostname As String)
Dim objMail As New MailMessage
Try
objMail.To = "(e-mail address removed)"
objMail.From = "(e-mail address removed)"
objMail.Subject = "Testing"
objMail.Body = "Body"
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.registeredsite.com") 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1) 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2) 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "myusername") 'set your username here
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password") 'set your password here
SmtpMail.Send(objMail)
Catch ex As Exception
Throw ex
End Try
End Sub
I really need help on this so that I can finish this project.
have posted here several times already. I need to be able to send email using
winforms, vb.net 2003 or 2005 through a remote smtp server. The server is
hosted by Web.com and I have talked to them but their support is NO HELP at
all.
I keep getting the error: Could not access 'CDO.Message' object
Here is the code that I am using:
Public Sub sendEmail(ByVal hostname As String)
Dim objMail As New MailMessage
Try
objMail.To = "(e-mail address removed)"
objMail.From = "(e-mail address removed)"
objMail.Subject = "Testing"
objMail.Body = "Body"
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.registeredsite.com") 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1) 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2) 'basic authentication
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "myusername") 'set your username here
objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password") 'set your password here
SmtpMail.Send(objMail)
Catch ex As Exception
Throw ex
End Try
End Sub
I really need help on this so that I can finish this project.