Send Email via ASP.NET Code

DarenTx
Posts: 2
Joined: Sun Jun 12, 2011 9:31 pm

Send Email via ASP.NET Code

Postby DarenTx » Sun Jun 12, 2011 9:40 pm

I'm clueless. Be gentle.

I have a new virtual server running Windows Server 2008 Standard Edition. It runs 3 extremely low traffic websites. From these websites, I need to send 1 or 2 notification emails each day. The emails are sent via c# code when certain events happen. The emails are sent to users of the site so I am sending to various hosts (gmail, yahoo, hotmail, etc). The websites were hosted elsewhere before and the emails worked fine at the other host. My code is correct. My configuration is not. The websites and MailEnable are on the same virtual server.

My first question would be, Do I even need MailEnable in this scenario? I think I do because I need some sort of SMTP Relay, right?

I installed MailEnable on my virtual server. I created one mailbox called notifications@mydomain.com. I gave it a password. I updated my configuration to include this new mailbox account and password. When I try to send an email from the web page it comes back with this error, "Your message was not sent. Error: Bad sequence of commands. The server response was: This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server."

I'm sure I have not provided a enough information. I'm not sure what information would be helpful for someone who knows what they are doing.

Any advice?

Brett Rowbotham
Posts: 511
Joined: Mon Nov 03, 2003 7:48 am
Location: Cape Town

Re: Send Email via ASP.NET Code

Postby Brett Rowbotham » Mon Jun 13, 2011 4:49 am

Have a look at this forum post:

http://forum.mailenable.com/viewtopic.php?f=4&t=19064

Cheers,
Brett

DarenTx
Posts: 2
Joined: Sun Jun 12, 2011 9:31 pm

Re: Send Email via ASP.NET Code

Postby DarenTx » Sun Jun 19, 2011 3:15 am

Thanks for the help. That message board thread did suggest I add 127.0.0.1 to my IP WhiteList which I have done but I get the same error.

I am pretty sure that the web.config and c# code is correct. I just don't have Mail Enable configured correctly.

I created a sample page that shows the error I am getting and the code I am using. You can access the test page here: http://dev.nocellpower.com/emailtest.aspx

Any other ideas?

sunny_jk
Posts: 1
Joined: Sun Oct 21, 2018 6:10 pm

Re: Send Email via ASP.NET Code

Postby sunny_jk » Sun Oct 21, 2018 6:17 pm

You can also try to send Email using ASP.NET C# as explained in the link below

https://qawithexperts.com/article/asp.net/send-email-using-c-mvc-net/16

Who is online

Users browsing this forum: No registered users and 18 guests