Send Mail Problem

M

Max

hi

I used mailmessage object to send the mail, my smtp server don't
require authentication, when i try to send the mail it shows error.
following is the code to send mail.

Dim mymail As New MailMessage
Dim smtp As SmtpMail
smtp.SmtpServer = "mailhost.gujarat.gov.in"
mymail.To = "(e-mail address removed)"
mymail.From = "mahesh (check mail delivery)"
mymail.Subject = "check mail delivery"
mymail.Body = "hi this is to check mail delivery"

mymail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
"25")

mymail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl",
"true")
Try
smtp.Send(mymail)
Label1.Text = "Mail sucessfully deliverd"
Catch ex As Exception
Label1.Text = ex.Message & "<br>" &
ex.GetBaseException.ToString
End Try

here i have add smtpserverport and smtpusessl fields only i have not
added smtpauthenticate.

now when i add smtpauthenticate=0 it shows same error.

if i remove all the fields and olny assign smtp.SmtpServer if through
following error.
Could not access 'CDO.Message' object.
System.Runtime.InteropServices.COMException (0x8004020E): The server
rejected the sender address. The server response was: 501 : domain
string is NULL.

Please Let me know if any one know the solution
 
S

sloan

http://sholliday.spaces.live.com/


I have complete 1.1 and 2.0 samples... with all 3 authentication methods.

2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)

If you're using IE and it crashes, try another browser like firefox.
Some recent IE update ... blows up your browers when going to the
spaces.msn.com site.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top