question

SangYongJin-1081 avatar image
0 Votes"
SangYongJin-1081 asked JoseZero-8614 answered

SMTP access to personal domain email using Asp.net mvc

Hi,

I have question for Smtp using my company domain based on outlook.

I tried to setup Smtp using C# but not working..

The error message said "System.Net.Mail.SmtpException: 'Transaction failed. The server response was: 5.2.252 SendAsDenied; sangyong@personaldomain.com not allowed to send as DoNotReply@localhost;"

my Webconfig code is below:

<network host="smtp.live.com" port="587" userName="sangyong@personaldomain.com" password="Password" defaultCredentials="false" enableSsl="true" />

Please tell me which server host should I use it?

I tried to use a lot of server URL, but not working..

smtp-mail.outlook.com

smtp.live.com

I am really frustrated now.. please help..

dotnet-aspnet-webpages
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SangYongJin-1081 ,
I think you could try to send the message with a same email address to that of the account you were sending from like this:
change:

 sangyong@personaldomain.com

to:

 sangyong@outlook.com

Best regards,
Yijing Sun

0 Votes 0 ·

1 Answer

JoseZero-8614 avatar image
0 Votes"
JoseZero-8614 answered

Too many years ago a Mail Server was able t accept mail from any sender, later due bad use and lots of spams, SMTP Mail Servers changed to accept only mails from same domain.
If you are an authenticated user and trying to post a message where sender is from same domain it should accept your message and place it on Server Outbox Queue. So as soon as possible it will be processed and delivered.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.