Error Sending Email from .NET

Hey there.

Ive made a signup script that authenticates users email by sending an activation code to their email address. The problem im getting is the following...

The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication. Please check your mail client settings.

Now Ive been told this can be sorted via settings on the server but Ive emailed my hosting providers and they cant/wont change these settings... so is there any way I can get around this from within ASP.NET

I would really appreciate any and all suggestions.

Many Regards
0
boomers
8/10/2005 5:40:18 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

7 Replies
608 Views

Similar Articles

[PageSpeed] 9

Yea, specify a different smtp server.
In this world there are 10 types of people, those that know binary and those who don't.
0
Optik
8/10/2005 7:03:38 PM

Anyway of doing it via the code - in terms of changing the code?

0
boomers
8/10/2005 7:20:18 PM

Yes, your SmtpMail object has an SmtpServer property that accepts a string object that represents the mail server to use (if none is specified, it defaults to locahost).  Just change the property :)

SmtpMail.SmtpServer = "MailServer DNS name or IP"
SmtpMail.Send(MyMail)


In this world there are 10 types of people, those that know binary and those who don't.
0
Optik
8/10/2005 7:34:26 PM
Hi,
Try with this..  SmtpMail.SmtpServer = "127.0.0.1", which means it sends mails from the local server

HTH
Mark post(s) as "Answer" that helped you

Electronic Screw
Website||Blog||Dub@i.net
0
e_screw
8/10/2005 7:44:58 PM
You need to have permission to relay your email through a smtp server.
Usually - choosing your own ISP smtp server will work - but in your
case, they have authentication turned on. There may be a way to send
the authentication check systemwebmail.com
and just now as I checked that link - I see they have a FAQ on authentication
if you can't work it out with that smtp server, then you will need a different server, or run the smtp service on your server - (if it's your server)

HTH


Hope That Helps
All that wander, are not lost...
What were we talkin bout
0
uncleb
8/10/2005 9:02:18 PM
 boomers wrote:
The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication. Please check your mail client settings.
The SMTP server you are sending through requires an account name and password to send mail.

 boomers wrote:
Now Ive been told this can be sorted via settings on the server but Ive emailed my hosting providers and they cant/wont change these settings... so is there any way I can get around this from within ASP.NET
It's understandable.  Your hosting provider could allow relay through the server, but it opens them up to potential abuse.  Authentication is a way to prevent spammers from compromising servers.

Fortunately, System.Web.Mail allows for authentication.  In your code, in the appropriate section where you build your message parameters, add these lines:

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
mail.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendusername", "username")
mail.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendpassword", "password")

Naturally, use your own username and password.  Check the System.Web.Mail FAQ as well, at:

http://www.systemwebmail.com/faq/3.8.aspx

Jeff

Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
jeff
8/10/2005 10:03:15 PM

Its all working perfectly now.

Thats great - you guys really came through for me thank you all very very much.

0
boomers
8/10/2005 10:32:03 PM
Reply: