I am developing ASP.NET web application.
In that, i am sending mail to end user from my SQL Mail profile.
i have the below mail profile and account name and mail id.
SQL Mail Account Name : IND GROUP MAIL
E-mail ID : indteamsupport@jeevesteam.com
We are sending mail from "indteamsupport@jeevesteam.com", but, SQL Mail Account name "IND GROUP MAIL" not displaying in the from account.
It should come like below to end user.
From : IND TEAM MAIL indteamsupport@jeevesteam.com
To : xxxxxxx
End user getting mail without "IND GROUP MAIL" this. .....?
below is the ASP.NET (C#) code for sending mail to end user.
using System;
using MailKit.Net.Smtp;
using MailKit;
using MimeKit;
namespace TestClient {
class Program
{
public static void Main (string[] args)
{
var email = new MimeMessage();
email.From.Add(new MailboxAddress("Sender Name", "IND TEAM MAIL <indteamsupport@jeevesteam.com>"));
email.To.Add(new MailboxAddress("Receiver Name", "xyz@email.com"));
email.Subject = "Testing out email sending";
email.Body = new TextPart(MimeKit.Text.TextFormat.Plain) {
Text = "Hello all the way from the land of C#"
};
using (var smtp = new SmtpClient())
{
smtp.Connect("smtp.server.address", 587, false);
// Note: only needed if the SMTP server requires authentication
smtp.Authenticate("smtp_username", "smtp_password");
smtp.Send(email);
smtp.Disconnect(true);
}
}
}
}