Open Closed

Email not being sent to gmail accounts from docker deployment on azure #3692


User avatar
0
AdamMusson created

When I deploy the application to a docker container on azure I find that emails to gmail accounts are not accepted. I have created an email with 123-reg server and am using this to send out the emails on user registration.

The email gets sent successfully to many email accounts I have but is rejected by all the gmail accounts I have tested. The response is below. How can we set the MessageId in abp?

Any help would be appreciated as I need to allow users with gmail addresses to be able to register.

FYI, The message id header is not required currently, but is used by several spam filters including gmail. As for what it needs to be set to, something unique.

  • ABP Framework version: v6.0.0-rc1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:none but here is the response from gmail when sending the email This is an automatically generated Delivery Status Notification.

Reason: There was an error while attempting to deliver your message with [Subject: "Please Confirm your email"] to adam.musson@gmail.com. MTA p3plwbeout16-03.prod.phx3.secureserver.net received this response from the destination host IP - 142.250.141.27 - 550 , 550-5.7.1 [173.201.193.58] Messages missing a valid messageId header are not 550 5.7.1 accepted. lb10-20020a17090b4a4a00b00200b96d234csi12474831pjb.49 - gsmtp

  • Steps to reproduce the issue:" Deploy the application to docker and try and register to get a confirmation email

6 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, this problem is related to the Google SMTP server and it's not related to ABP. So, please search it on Google.

    Probably, you need to setup your application's IP address to the Google SMTP server.

    Also, you can check: https://support.google.com/a/answer/176600?hl=en#zippy=%2Cuse-the-gmail-smtp-server

  • User Avatar
    0
    AdamMusson created

    Hi, Are you saying that in an ABP application we are forced to use the Google SMTP server? And therefore create a gmail email address for the sending of emails from the application.

    I am sending email from the 123-reg SMTP server and so I am not using the Google SMTP server. The problem is that because we can't set the MessageId using the ABP IEmailSender the Gmail Spam filters prevent emails from being delivered to Gmail addresses meaning people with Gmail accounts can't register for the application and confirm their emails.

    If we could set the MessageId in the email header we could send email from any SMTP server and they would pass through the spam filter used by Gmail. It seems to me that if the ABP email sending service added this header the issue would be fixed.

    The emails are sent successfully to email accounts that don't check the messageId for spam with my current setup.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, Are you saying that in an ABP application we are forced to use the Google SMTP server? And therefore create a gmail email address for the sending of emails from the application.

    Hi, no we do not have to use the Google SMTP server.


    I misunderstood your question, sorry for that. I'll check what we can do to overwhelm your problem and write you back asap.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, I guess you're using Mailkit package of ABP Framework right? If so, you can override the MailKitSmtpEmailSender class as follow:

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs#L31-L39

  • User Avatar
    0
    AdamMusson created

    Thanks - that's great. I noticed you have checked this into the Abp MailKitSmtpEmailSender too now. Will this be included in the version 6.0 final release? Or will it be sometime later that we will no longer need to do this override ourselves?

    Thanks a lot.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thanks - that's great. I noticed you have checked this into the Abp MailKitSmtpEmailSender too now. Will this be included in the version 6.0 final release? Or will it be sometime later that we will no longer need to do this override ourselves?

    Thanks a lot.

    Hi, it will be available from v7.0, so if you want to use it in meantime you need to override the method. Best regards.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38