Reputation: 2428
I want to send a mail with through ASP.Net.But,that's gives me "SendUsing" error.
Code:
<%
string strKime = "[email protected]";
string strKimden = "[email protected]";
string strKonu = "ASP.net mail gönderme işlemi";
string strMetin = "Bu sayfa asp.net mail komponenti tarafından gönderildi";
System.Web.Mail.SmtpMail.Send(strKimden, strKime, strKonu, strMetin);
%>
Upvotes: 0
Views: 506
Reputation: 52241
Did you add the SMTP
settings in the web.config
file?
<system.net>
<mailSettings>
<smtp>
<network
host="ServerHostname"
port="portNumber"
userName="username"
password="password" />
</smtp>
</mailSettings>
Email sending requires SMTP
settings.
Upvotes: 1
Reputation: 3475
Perhaps, SMTP Server is not configured correctly? it is recommended that we always specify the definite smtpserver names for when calling the System.Web.Mail components or CDO.
Not sure if you are using this directly in the markup. Ideally, you should have a common code that sends emails taking the required parameters. Check out the link in one of the other answers.
Upvotes: 1
Reputation: 2499
You have to set the SmtpClient Host property to the "mail.hot.com" or the ip of your outgoing mail server.
Upvotes: 0