Error sending email in SendMailMessage: Mailbox unavailable.

Topics: ASP.NET 2.0, Business Logic Layer
Sep 4, 2014 at 9:21 AM
Edited Sep 4, 2014 at 9:43 AM
Hi,

I get the following error message in my log file. I am using be.net 2.8.

I have configured my smtp settings and when I test the settings i do get an email test message.
However, somewhere in the code either when a post is made, i am getting this message (once for each person in the newsletter list).

Ive read some where that emails are sent when two conditions are met, but what are they?
Does an email get sent for each new post added, if so where do i control this?
Does an email get sent for each new comment added to a post?
Is this some thing i need to change at the site hosting level, regarding the relaying of credentials?

I'm trying to scan the code, but if someone can save me the time, i would greatly appreciate it.

Error sending email in SendMailMessage: Mailbox unavailable. The server response was: Authentication is required for relay
Sep 4, 2014 at 9:46 AM
Hi,

What is your mail server ? Is it the same that server where is hosted BE ?
Without know all details, i think that your mail server must give autorisation to your BE server to send email.
You must add i'm IP adress in server which have right to send messages.

Hope that this can help you.

Best regards
David Foret
Sep 4, 2014 at 10:00 AM
Hi David.

yes my mail server is where be is hosted.
smtp server mail.idrawcreatures.com
port 25
email address admin@idrawcreatures.com password etc etc....

mail does get sent from the email test page, but not from the code?
Am i missing something, do i need to include my smtp settings in my web.config, as well as having them on the email page?

Thanks for your help..
Sep 4, 2014 at 10:10 AM
So if i make short:

server1 is web server
server1 is mail server

When you send a test email from BE, this message go out, but when you send newsletter, message don't go out and you receive back message in bold in your first post. This message is write somewhere in BE, in what page exactly and for what function ?

Do you have a printscreen of this message ?

i didn't put my smtp configuration in web.config.
I can send email for all functiona rround password retrieval, i think that in admin it's enought.

With message i more thinking about a limitation in your mail server.

What mail server do you use ? What is the adress of mail sender, is it the same for test and for other pages ?

Best regards
David Foret
Sep 4, 2014 at 10:37 AM
HI David.
My hosting is with aspnethosting.co.uk
Their kb article says to use mail.yourdomainnamehere.com port 25 and a valid email address.
I have entered each of these into the be email settings page, and the test email settings does indeed send an email, so i know emails can go from the server though the smtp server and arrive.
But it doesnt appear to work when i publish a post, or add comments.

Again, many thanks for your help.

below is the be log file...

--i purged the log file.
--i have two entries in my newsletter xml file (both with valid email addresses for testing)
--The last message was me testing if i needed ssl turned on (but thats not supported on my isp)

Purged at 9/4/2014 10:14:27 AM
---------------------------------------
Date: 9/4/2014 10:26:24 AM
Error sending email in SendMailMessage: Mailbox unavailable. The server response was: Authentication is required for relay
---------------------------------------
Date: 9/4/2014 10:26:24 AM
Error sending email in SendMailMessage: Mailbox unavailable. The server response was: Authentication is required for relay
---------------------------------------
Date: 9/4/2014 10:27:10 AM
Error sending email in SendMailMessage: Server does not support secure connections.
;
Sep 4, 2014 at 10:45 AM
Hello Randalthor,

Did you read this kb http://portal.aspnethosting.co.uk/knowledgebase.php?action=displayarticle&id=13 ?

Try to change smtp port to 465 and check SSL.

Best regards
David Foret
Sep 4, 2014 at 10:59 AM
Edited Sep 4, 2014 at 11:14 AM
Hi,
Yes. I have tried the above, and 8889 (port 25 was blocked).
again the test email gets sent correctly, but when its the code in BlogEngine.core.Utils doing the sending, then nothing gets through and i just see the entry in the log file?
I think im gonna have to debug into it.?


[Edit]
strange, the exact same settings in my dev image, work and emails are sent following the publishing of a post. Im gonna have to compare the codes, otherwise it means its environmental and something to do with hosting?
Sep 4, 2014 at 11:45 AM
Hi,

effectively i think the same, that this is somewhere with mailserver, in hosting.
Can you check with another mail settings, maybe a google or outlook.com mailbox ?

Best regards
David Foret