SMTP Setup and Authenticate issues with Exchange

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
9/29/2013 5:09:55 PM
Gravatar
Total Posts 5
SFC John Gately Texas Military Department - Webmaster johnny.gately@txsg.state.tx.us 972-800-9160

SMTP Setup and Authenticate issues with Exchange

MojoPortal Version 2.3.9.7 MSSQL

When setting up email information in the User.Config file, I have the following.

<!-- Email Settings-->
    <add key="SMTPServer" value="MYEMAILSERVER"/>
    <add key="SMTPRequiresAuthentication" value="false"/>
    <add key="SMTPPort" value="25" />
 

Just for fun, this is what's in my Web.Config file.

 <add key="SMTPServer" value="localhost" />
      <add key="SMTPRequiresAuthentication" value="false" />
      <add key="SMTPUseSsl" value="false" />
      <add key="SMTPPort" value="25" />
      <add key="SMTPUser" value="UserName" />
      <add key="SMTPPassword" value="UPassword" />
    <add key="SMTPTimeoutInMilliseconds" value="30000" />

However, when we try sending an email from the website to our exchange server, the system tries to authenticate. But from the server itself, we can send mail using SMTP without any issue.

2013-09-24 14:07:05,014 ERROR 208.36.139.5 - en-US - /Events/PurchaseTicket.aspx?pageid=146&mid=179&ItemID=5 - mojoPortal.Net.Email - error sending email to MYEMAILADDRESS from MYEMAILADDRESS, will retry 

System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender

   at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)

   at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)

   at System.Net.Mail.SmtpClient.Send(MailMessage message)

   at mojoPortal.Net.Email.Send(SmtpSettings smtpSettings, MailMessage message)

2013-09-24 14:07:08,093 ERROR 208.36.139.5 - en-US - /Events/PurchaseTicket.aspx?pageid=146&mid=179&ItemID=5 - mojoPortal.Net.Email - all retries failed sending email to MYEMAILADDRESS from MYEMAILADDRESS, message was: 

System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender

   at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)

   at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)

   at System.Net.Mail.SmtpClient.Send(MailMessage message)

   at mojoPortal.Net.Email.Send(SmtpSettings smtpSettings, MailMessage message)

SGT Gately

10/3/2013 1:44:02 PM
Gravatar
Total Posts 18439

Re: SMTP Setup and Authenticate issues with Exchange

Hi John,

Sorry for the delayed response was busy with making new releases of mojoPortal and other features and just getting through all my backlog of messages.

"System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender"

Make sure that the default "Email From Address" in Site Settings is a valid email for your mail server, and since this specific email is from Event Calendar Pro, make sure the "Email From Address" in Settings > Ticket/Registration Settings is either blank (in which case it will use the one from Site Settings) or a valid email address that can send mail from your domain

Note that <appSettings in user.config override ones in Web.config so for any setting that does exist in user.config the same setting in Web.config does not matter, it will use the one from user.config. If it doesn't exist in user.config then it will use the one from Web.config.

Normally I would expect that a username (or email address) and password would be needed in the smtp settings ie SMTPUser would be an email address (typically the same one as in Site Settings) and SMTPPassword would be the password for the given email address to allow it to send mail. 

Hope that helps,

Joe

10/3/2013 8:19:37 PM
Gravatar
Total Posts 5
SFC John Gately Texas Military Department - Webmaster johnny.gately@txsg.state.tx.us 972-800-9160

Re: SMTP Setup and Authenticate issues with Exchange

Joe, 

Thanks for the reply on my issue.  I have made sure that my setting were correct and I have even added SMTPUser and Password.  I am still having the same issue.

Again, straight from the server, I am able to sent an EMAIL from our webserver.

Here is the packet capture from one of our trys. Look at line 24

https://www.txsg.state.tx.us/Data/Sites/1/txsgdocs/admin/esmtp_session_packets.pdf

<!-- Email Settings-->
    <add key="SMTPServer" value="MYEMAILSERVER"/>
    <add key="SMTPRequiresAuthentication" value="false"/>
    <add key="SMTPPort" value="25" />
    <add key="SMTPUser" value="MYEMAILADDRESS"/>
    <add key="SMTPPassword" value="MYPASSWORD"/>

2013-10-03 20:00:28,388 ERROR 172.16.203.4 - en-US - /Events/PurchaseTicket.aspx?pageid=146&mid=179&ItemID=56 - mojoPortal.Net.Email - error sending email to MYEMAILADDRESS from MYEMAILADDRESS, will retry 

System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender
   at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)
   at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at mojoPortal.Net.Email.Send(SmtpSettings smtpSettings, MailMessage message)
2013-10-03 20:00:31,467 ERROR 172.16.203.4 - en-US - /Events/PurchaseTicket.aspx?pageid=146&mid=179&ItemID=56 - mojoPortal.Net.Email - all retries failed sending email to MYEMAILADDRESS from MYEMAILADDRESS, message was: Dear Johnny Gately

 

System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender
   at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)
   at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at mojoPortal.Net.Email.Send(SmtpSettings smtpSettings, MailMessage message)

 

SGT Gately

10/4/2013 6:33:52 AM
Gravatar
Total Posts 18439

Re: SMTP Setup and Authenticate issues with Exchange

Hi John,

The error message is very clear that the smtp server is rejecting it based on the from address being used.

"Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender"

Line 24 and other lines in the pdf look ok, but line 40 shows the error.

"Client" in this case I would think refers to the web server. The web server may have more than one ip address, make sure all the ip addresses used by the web server are allowed to relay to the smtp server. If you have someone who is the administrator of the mail server I would check with them what other security restrictions may apply.

Hope that helps,

Joe

 

 

You must sign in to post in the forums. This thread is closed to new posts.