Base solution for your next web application
Open Closed

EmailSender From Email param ignored #2589


User avatar
0
kevwiggy created

Hi,

I am setting the from email address to :

await _emailSender.SendAsync("no-reply@" + tenancyName + ".com.au", user.EmailAddress, "Password Reset", emailTemplate.ToString());

But its still coming through as the host name

Cheers


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you share how do you get value for tenancyName parameter ?

    Thanks.

  • User Avatar
    0
    kevwiggy created

    UserEmailer.cs line 104.

    var tenancyName = GetTenancyNameOrNull(user.TenantId);

    But the from address for the reset password email is the address set in the Host SMTP settings even though I am passing in a different from address

    So I am passing in the params; await _emailSender.SendAsync("no-reply@" + tenancyName + ".com.au", user.EmailAddress, "Password Reset", emailTemplate.ToString());

    Ie. Adding a From address in the first parameter but I am still getting the SMTP Host settings From address

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you try it with creating a MailMessage and use it like and see if it behaves the same ?

    await _emailSender.SendAsync(mailMessage);