i am using the following code to send an email from a asp.net (1.1 ) page
err i am getting is ,
The transport failed to connect to the server.
if i use try catch block then
ex.message returns "Could not access 'CDO.Message' object."
VB Code:
Dim mail As New Mail.MailMessage
Dim SmtpMail As Mail.SmtpMail
mail.Subject = "this is a test email."
mail.Body = "mail body"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1) 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sender") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypass") 'set your password here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587)
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", True)
SmtpMail.SmtpServer = "smtp.myserver.com"
SmtpMail.Send(mail)
1. the error is generated when i run the aspx page on my dev machine ( win xp pro sp2 iis 5.1)
2. but it works fine if i put the page on my smtp server ( "smtp.myserver.com" )
3. what makes it complicated is , it also works in vs 2005 using net.mail namespace ( on the same machine of case 1 )
somebody got to help me on this.
Thanks.