Open Closed

Email Sender not working #4095


User avatar
0
mikeolofernes created

HI,

I tried the Email Sending function you have and it is not working. The details I saved on the Settings/Emailing is not loading. I also tried the Send test email and its also not working.

Thanks, Mike If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v6.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes /
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

18 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    What's the value of your Host setting?

  • User Avatar
    0
    mikeolofernes created

    hi

    What's the value of your Host setting?

    I used 104.21.13.176 for testing, but the first issue is that the values I saved is not loading.

    Thanks, Mike

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    but the first issue is that the values I saved is not loading.

    I don't get it. Can you explain more?

    I also tried the Send test email and its also not working.

    Please remove the NullEmailSender.

    #if DEBUG
            context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
    #endif
    
  • User Avatar
    0
    mikeolofernes created

    but the first issue is that the values I saved is not loading.

    I don't get it. Can you explain more?

    I also tried the Send test email and its also not working.

    Please remove the NullEmailSender.

    #if DEBUG 
            context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); 
    #endif 
    

    As you can see in this screenshot, SMTP Host is still null. Already removed the NullEmailSender. The test send email works now but if i use this code, the SMTP Host and other values are still null. Thanks, Mike

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you reproduce it in a new template project? liming.ma@volosoft.com

  • User Avatar
    0
    mikeolofernes created

    hi

    Can you reproduce it in a new template project? liming.ma@volosoft.com

    Create a new project from scratch? I havent tried that but this project of ours is still new, no development made on the backend, only on the frontend side.

    I am thinking, the values are not initiating properly? Do I need to load/initiate it manually? Do note that send test email is working, I just created a test function to send an email but the values like SMTP host is not loading.

    Thanks, Mike

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    What are full steps to reproduce in a new template?

  • User Avatar
    0
    mikeolofernes created

    What are full steps to reproduce in a new template?

    Are you talking about the email template?

  • User Avatar
    0
    mikeolofernes created

    I am confused. Why are you asking me to create a new template? We used command lines to create the solution. something like abp new Acme.IssueManagement -t module-pro

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Could you share the full steps to reproduce it? as you know, we need to reproduce it first and then find a solution

  • User Avatar
    0
    mikeolofernes created

    I put the code in the backend of Blazor razor page then just created a button on the frontend to trigger the code.

    using System; using System.Threading.Tasks; using Volo.Abp.Emailing; using Volo.Abp.Emailing.Templates; using Volo.Abp.TextTemplating;

    namespace FireBird.Blazor.Pages;

    public partial class Index { private readonly IEmailSender _emailSender; private readonly ITemplateRenderer _templateRenderer;

    public Index(
    IEmailSender emailSender,
    ITemplateRenderer templateRenderer)
    {
        _emailSender = emailSender;
        _templateRenderer = templateRenderer;
    }
    
    public async Task email()
    {
        try
        {
            var body = await _templateRenderer.RenderAsync(
            StandardEmailTemplates.Message,
            new
            {
                message = "This is email body ABP test..."
            }
        );
    
            await _emailSender.SendAsync("mikeo@theservicemanager.com",
                "mikeo@theservicemanager.com",
                "ABP Email subject test",
                "This is email body ABP test..."
            );
        }
        catch (Exception ex)
        {
            var x = ex.Message;
        }
        
    }
    

    }

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    What are the values of the SMTP settings?

  • User Avatar
    0
    mikeolofernes created

  • User Avatar
    0
    mikeolofernes created

    Do I need to share also the password?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Yes please send it to liming.ma@volosoft.com I will test it.

  • User Avatar
    0
    mikeolofernes created

    Password sent. You did not respond.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Can I check your app by zoom remotely?

    https://us05web.zoom.us/j/89210760707?pwd=NW1wVWovMlR0ZE1pVzR3dUZhMm52QT09

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi mikeolofernes

    I have confirmed.

    You can get email settings from blazor app, because the email settings are not visible to client.

    You can only call an API from blazor, and the backend to send to email.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15