sending mail using asp.net?

Zpixel

New Member
i found a method in web to send asp.net mails<br />
<br />
public void SendSMTPEMail<br />
(string strSmtpServer, <br />
string strFrom, <br />
string strFromPass, <br />
string strto, <br />
string strSubject, <br />
string strBody)<br />
...<br />
<br />
it is ok on 127.0.0.1 smtp server. but when i published my pages to host space, there is an error sending mail<br />
<br />
System.Net.Mail.SmtpException<br />
Failure sending mail<br />
An existing connection was forcibly closed<br />
by the remote host at<br />
System.Net.Sockets.Socket.Receive<br />
<br />
is there any botherless method to send mail using asp.net. thanks for some code.<br />
 

EdSF

New Member
You have to ask your host what methods they allow/provide for you to send mail.

ASP.Net has the System.Net.Mail which you can look into. I'm purposely not putting up code so you can understand how to do it properly - it's really not difficult, less than 10 lines of code.

This way, depending on what your host says, you can make the necessary adjustments, or may have to use something else altogether (what your host provides/allows).
 
Top