Open Closed

smtp integration #5896


User avatar
0
s.alshammari.c created

Hello,

I am using smtp4dev and tying to integrate with the emailing feature in the abp.

when I send email using "Send test email" button , i didn't receive any email .

here is my server host and port already tested that is working using powershell command "Send-MailMessage -To “test@test.com” -From “admin@test.com” -Subject “MyMail” -Body “This is the test” -SmtpServer "localhost" -Port "25"

but its not working in abp


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

    hi

    Check your logs.txt

    There may be this line in your app. Please remove it.

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

    https://github.com/abpframework/abp-samples/tree/master/EmailSendDemo

  • User Avatar
    0
    s.alshammari.c created

    I configured my smtp server and I am getting this exception

    Failure sending mail. System.Net.Mail.SmtpException: Failure sending mail.  ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.  at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)  at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)  at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please test your mail configuration by https://github.com/abpframework/abp-samples/tree/master/EmailSendDemo

  • User Avatar
    0
    s.alshammari.c created

    I got same Exception

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

    This has nothing to do with ap. Please check your configuration.

  • User Avatar
    0
    salih created
    Support Team .NET Developer

    Send-MailMessage -To “test@test.com” -From “admin@test.com” -Subject “MyMail” -Body “This is the test” -SmtpServer "localhost" -Port "25" This command didn't work for me.

    Send-MailMessage -To “test@test.com” -From “admin@test.com” -Subject “MyMail” -Body “This is the test” -SmtpServer "localhost" -Port "2525" But this command worked

    So I updated my settings like this and it worked

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11