473,473 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Send Mail Problem

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
1 1375
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
1
by: Sophie | last post by:
Hi, I'm not very good in english so excuse me if I have difficulty to explain my problem. I want to send a mail with VB.net with this code : Option Strict On Public Class Form1 Inherits...
10
by: Dennis | last post by:
I am trying to send an e-mail using one of the examples I got on this group as follows: (both toemail and myemail are valid e-mail addreses. 'System.Web.Mail' (requires reference to...
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
14
by: Professor Yonce | last post by:
I have made form for E-Mail. I have entered code but the Import system does not work. It has squiggly line underneath it showing it is not communicating. It Will not build. Public Class...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.