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();
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!
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.
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)
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!
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
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
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)
is working on a reply...