Web config
====================
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mail.seologistics.com" enableSsl="false" port="587" userName="test_flexsin@seologistics.com" password="Ybv0B'mJKLIU*%$" />
</smtp>
</mailSettings>
</system.net>
-----------
<add key="FromEmailId" value="test_flexsin@seologistics.com" />
<add key="DisplayName" value="Wafroo" />
==============================================
Code
============
public string SendMail(string FromEmail, string ToEmail, string subjectsend, string messagesend)
{
string Result = string.Empty;
try
{
var fromAddress = new MailAddress(FromEmail);
var toAddress = new MailAddress(ToEmail);
string subject = subjectsend;
string body = messagesend;
var smtp = new SmtpClient();
using (var message = new MailMessage(fromAddress, toAddress)
{
Subject = subject,
Body = body,
})
{
message.IsBodyHtml = true;
smtp.Send(message);
}
Result = "1";
}
catch (Exception ex)
{
Result = ex.Message;
}
return Result;
}
====================
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mail.seologistics.com" enableSsl="false" port="587" userName="test_flexsin@seologistics.com" password="Ybv0B'mJKLIU*%$" />
</smtp>
</mailSettings>
</system.net>
-----------
<add key="FromEmailId" value="test_flexsin@seologistics.com" />
<add key="DisplayName" value="Wafroo" />
==============================================
Code
============
public string SendMail(string FromEmail, string ToEmail, string subjectsend, string messagesend)
{
string Result = string.Empty;
try
{
var fromAddress = new MailAddress(FromEmail);
var toAddress = new MailAddress(ToEmail);
string subject = subjectsend;
string body = messagesend;
var smtp = new SmtpClient();
using (var message = new MailMessage(fromAddress, toAddress)
{
Subject = subject,
Body = body,
})
{
message.IsBodyHtml = true;
smtp.Send(message);
}
Result = "1";
}
catch (Exception ex)
{
Result = ex.Message;
}
return Result;
}