Pentru trimiterea de emailuri de pe platformele Windows este obligatoriu sa utilizati "SMTP authentication". Aveti mai jos un exemplu de cod C# (este necesar sa il adaptati nevoilor dvs.):
***********************************************************************************
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress("[email protected]", "From Name");
// You can specify the host name or ipaddress of your server
smtpClient.Host = "mail.yoursite.com"; //you can also specify mail server IP address here
//Default port will be 25
smtpClient.Port = 25;
NetworkCredential info = new NetworkCredential("[email protected]", "smtp-password");
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = info;
//From address will be given as a MailAddress Object
message.From = fromAddress;
// To address collection of MailAddress
message.To.Add("[email protected]");
message.Subject = "Your subject";
// CC and BCC optional
// MailAddressCollection class is used to send the email to various users
// You can specify Address as new MailAddress("[email protected]")
//message.Bcc.Add("[email protected]");
//Body can be Html or text format
//Specify true if it is html message
message.IsBodyHtml = false;
// Message body content
string ss_body = "body of email is here";
message.Body = ss_body;
// Send SMTP mail
smtpClient.Send(message);
***********************************************************************************
Cele mai populare articole
System.Security.SecurityException sau That assembly does not allow partially trusted callers
Daca la rularea unei aplicatii ASP .NET va este returnata eroarea:...
Este URL Rewrite disponibil pe platforma Windows ?
Da, URL Rewrite este disponibil pentru toate abonamentele Windows.
AJAX: Unknown server tag 'asp:ScriptManager'
In cazul in care la accesarea aplicatiei dvs. ASP .NET apare mesajul "AJAX: Unknown server tag...
Cum se configureaza conectarea la MySQL cu ASP.NET ?
<%@ import namespace="System.Data" %> <%@ import namespace="MySql.data.MySqlclient"...
