Copied to clipboard

Flag this post as spam?

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


  • Erik Ernst 70 posts 90 karma points
    May 27, 2010 @ 08:39
    Erik Ernst
    0

    Strange Error: Cannot send emails to hotmail accounts

    I'm having a strange error, I'm not really sure that it has anything to do with Umbraco, but maybe someone have experienced the same?

    I'm using Osmembercontrols, but with my own modified code to send mail.

     

                                string emailtext = doc.getProperty(PropertyContainingEmail).Value.ToString();

                                MailAddress to = new MailAddress(m.Email, m.LoginName);
                                MailAddress from = new MailAddress(
                                    doc.getProperty(PropertyContainingFromEmail).Value.ToString(),
                                    doc.getProperty(PropertyContainingFromName).Value.ToString());

                                MailMessage mm = new MailMessage(from, to);
                                SmtpClient s = new SmtpClient();

                                mm.Subject = doc.getProperty(PropertyContainingSubject).Value.ToString();
                                mm.Subject = mm.Subject.Replace("##loginname##", m.LoginName);
                                mm.Body = emailtext.ToString();
                                mm.Body = mm.Body.Replace("##loginname##", m.LoginName);
                                mm.Body = mm.Body.Replace("##email##", m.Email);
                                mm.Body = mm.Body.Replace("##password##", m.Password);
                                mm.IsBodyHtml = true;

                                foreach (PropertyType p in mt.PropertyTypes)
                                {
                                    try
                                    {
                                        mm.Body = mm.Body.Replace("##" + p.Alias + "##", m.getProperty(p.Alias).Value.ToString());
                                    }
                                    catch
                                    {

                                    }
                                }

                                s.Send(mm);

     

    When checking the log files of my Exchange 2010 server, then it looks fine, no errors, but the mails are never arriving and are also I'm not receiving any error message!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 27, 2010 @ 08:45
    Dirk De Grave
    0

    Are you sending an email to the same account as specified in web.config? It just doesn't work and you don't get an error message.

     

    Hope this can help.

    Cheers,

    /Dirk

  • Erik Ernst 70 posts 90 karma points
    May 27, 2010 @ 09:26
    Erik Ernst
    0

    Hi Dirk,

    Thank you , but I'm not quite sure what you mean. The hotmail account which I'm sending to is not specified in web.config.

    But I am sending using the same email account as the from address/sender as I have specified in web.config. If I'm using a different email account as the sender, then I'm getting an error that I cannot send emails.

    Rgds,
    Erik

  • eddy 43 posts 64 karma points
    Mar 15, 2011 @ 16:44
    eddy
    0

    Hi Erik,

    did you fix this one? I'm using the nibble emailer and am having the same problem with hotmail account. My log file shows the error but I'm struggling to find a solution.

    Eddy

    At /umbraco/dialogs/mailing.aspx?id=1329&rndo=31.9 :

    System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email protected] at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at Nibble.Umb.MailEngine.Library.SendMailFromPage(String FromMail, String ToMail, String Subject, Int32 PageId) at Nibble.Umb.MailEngine.dialogs.mailing.btnSend_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Please Sign in or register to post replies

Write your reply to:

Draft