Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael Nielsen 99 posts 619 karma points
    Oct 06, 2015 @ 10:35
    Michael Nielsen
    0

    library.sendmail stops working

    Having an issue with the library.sendmail function in a template.

    The template only contains this:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = null;
    
        library.SendMail("from@address.com","to@address.com","TEST","test test test", true);
    }
    
    Mail sent 
    

    (The to and from addresses are not the ones I am using)

    At first, it works fine, but after a little while, it stops sending out mails.

    The log file says this

    2015-10-06 12:18:29,013 [6] ERROR umbraco.library - [Thread 33] umbraco.library.SendMail: Error sending mail.
    System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'xx'
       at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6)
       at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback)
       at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
       at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       --- End of inner exception stack trace ---
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at umbraco.library.SendMail(String FromMail, String ToMail, String Subject, String Body, Boolean IsHtml)
    

    I do not know where "xx" as a remote name comes from. It has nothing to do with either reciever or sender of the mail.

    Recycling the app pool solves it for maybe a day or so.

    Umbraco version 7.1.6 assembly: 1.0.5350.25714

  • Michael Nielsen 99 posts 619 karma points
    Oct 16, 2015 @ 09:51
    Michael Nielsen
    0

    I've tried using a gmail account and sending through Google's SMTP server.

    The same thing happens, after a while, it stops sending out mails, and the tracelog then contains the same error.

    Mails from Umbraco Forms does not get send out either.

    Any ideas would be very much appreciated?

  • Michael Nielsen 99 posts 619 karma points
    Oct 23, 2015 @ 08:56
    Michael Nielsen
    100

    Solved it!

    For some weird reason, it works fine when changing the mail address entered in the UmbracoSettings.config file in the notifications section, to another than the clients mail address.

    So I'm guessing that it is the clients mail server configuration settings that is the cause.

    But that raises the question on why this affects mails sent out by the library.sendmail function and Umbraco.Forms? Is this setting not only for notifications?

    Especially when we're using our hosting providers SMTP to send the mails out, and sender adresses are set on the library.sendmail function and the individiual Umbraco.Forms.

    If anyone knows the reason to this, it would be nice with an explanation to it.

Please Sign in or register to post replies

Write your reply to:

Draft