YAFLogo

pavel
  • pavel
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Hello,

in 1.9.3 RC2 there is a slight problem with sending email. For "From:" current user is used, which might cause error with some ISP, that do not allow email relaying. I'm getting error:


System.Net.Mail.SmtpException: Mailbox name not allowed. The server response was: sorry, that domain isn't in my list of allowed senders (#5.7.1)
   at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
   at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at YAF.Classes.Utils.SendMail.Send(MailAddress fromAddress, MailAddress toAddress, String subject, String bodyText, String bodyHtml)
   at YAF.Classes.Utils.SendMail.Send(MailAddress fromAddress, MailAddress toAddress, String subject, String bodyText)
   at YAF.Pages.im_email.Send_Click(Object sender, EventArgs e)

But after modifying im_email.ascx.cs.Send_Click to directly use my email address I'm getting:


System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Threading.Thread.AbortInternal()
   at System.Threading.Thread.Abort(Object stateInfo)
   at System.Web.HttpResponse.End()
   at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
   at System.Web.HttpResponse.Redirect(String url)
   at YAF.Classes.Utils.YafBuildLink.Redirect(ForumPages page, String format, Object[] args)
   at YAF.Pages.im_email.Send_Click(Object sender, EventArgs e)

Right now unforunatelly I have no time to investigate further. Web.config, resp. mail.config are configured well.

Same applies also for emailtopic.ascx.cs. But changing here "From" to my real address WORKS.

Note: Why each of these methods is using different way of doing exactly the same - finding out email address (YAF.Classes.Data.DB.user_list vs. PageContext.User.Email)?

HTH


Pavel
Sponsor
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
16 years ago
PageContext is the current user... user_list gets a different user.