0
wizgod created
Greetings Programs!
I am using the following to send a message but when I receive the email, it is not using the default display name saved in the SMTP settings.
await _emailSender.SendAsync(new MailMessage
{
To = { recipient },
Subject = email.Subject,
Body = email.Message,
IsBodyHtml = true
});
The default email in the SMTP settings is set to [email protected] and the default display name is set to Notifications. When I receive emails in my gmail account, it displays as Do-Not-Reply <[email protected]> instead of Notifications which is what I'm expecting.
Thanks,
Wg
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
4 Answer(s)
-
0
Does this problem exist with other emails? For example
Outlook.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @maliming, it's the same with other email addresses and email clients (Outlook, iPhone Mail)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Does the code below work for you?
await _emailSender.SendAsync(new MailMessage { From = new MailAddress( "[email protected] ", "Notifications", Encoding.UTF8 ), To = { recipient }, Subject = email.Subject, Body = email.Message, IsBodyHtml = true });Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @maliming,
Yes, using that code is bringing in the default display name configured in Settings.
Thank!
Wg
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)