Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Tuesday, August 3rd at 3pm PST / 6pm EST. Learn more
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem sending form emails from website ASP.NET


the website I built needs to send email using a contact form. The hosting is godaddy shared windows hosting (plesk), email hosting is godaddy office365.
I can send and receive email using the webmail office365. However when I try to send the email from the website, the emails are sent but not received.
Website is ASP.NET MVC5 application and settings are (Send email using System.Net.Mail)

    <smtp from="">
      <network host="" port="25" />

There is no error in this case and the email appears to be sent, but it is never received.

I have also tried with
<network host="" port="587" userName="" password="####" defaultCredentials="false" enableSsl="true" />

in this case there is an exception thrown:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions

I have also added this record to DNS
v=spf1 mx a ~all

as suggested by Contact-Form-not-sending-email-to-Office-365-emai


I would appreciate any help. What should I do to make this work?