MaxCoder88
MaxCoder88

Reputation: 2428

Mail Sending problem with ASP.Net

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

Answers (3)

Muhammad Akhtar
Muhammad Akhtar

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

coder net
coder net

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

Samir Adel
Samir Adel

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

Related Questions