By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

Send Mail Problem

P: n/a
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 = "ma****@cybersurfindia.com"
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

Sep 1 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.


"Max" <ma***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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 = "ma****@cybersurfindia.com"
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/smtpserver
port",
"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

Sep 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.