Improve company productivity with a Business Account.Sign Up

x
?
Solved

asp.net to Office 365 smtp relay

Posted on 2011-09-25
8
Medium Priority
?
2,149 Views
Last Modified: 2013-11-27
I currently have an asp.net website that sends emails to my SBS2008 server.  I am in the midst of moving my email to office 365.  I need to edit the asp.net code to work with office 365 and make sure that office 365 is able to receive emails from my separately hosted website.  

Here is the code I have converted so far that does NOT work with Office 365:
           Dim client As New SmtpClient
           client.Host = "pod???.outlook.com"
           client.Port = 587
           client.EnableSsl = True
           client.Credentials = New NetworkCredential("email address", "password")
           client.Send(Message)

This code currently gets the following error:
5 The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated

The code above works with my SBS2008 server, but I am missing an important detail to make this work with Office 365.  I believe it has something to do with TLS, but I don't see anyother options to modify.

I should also mention that I would like the emails to show they come from the person submitting them from the website, to make it easy to reply to.  Making this a smtp relay question and that might mean I require additional configuration changes to my office 365 setup to allow it to accept these types of emails so it doesn't get caught as spam.
0
Comment
Question by:PianoMover
7 Comments
 
LVL 2

Expert Comment

by:sshoe0
ID: 36598562
You can use http://www.checktls.com/TestReceiver?FULL to check that the receiver will accept various emails.

You can use that same site's Watch Connect feature to watch your client (try to) connect to the server.  http://www.checktls.com/watchconnect.html
0
 

Author Comment

by:PianoMover
ID: 36936054
I've got the code to work if the email address is set to the account I am sending too in office 365.  The problem is the webform on the website is on behalf of the user, using the website.  The from email address needs to be from the input form.  I know this is possible on other websites like wordpress.  The question is how is it done.

Any other suggestions out there???
0
 
LVL 71

Expert Comment

by:Éric Moreau
ID: 36936102
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:PianoMover
ID: 36936345
Emoreau
I am looking for an asp.net code solution, not setting up a smtp server relay.
0
 
LVL 7

Expert Comment

by:Philonator
ID: 37801667
Emoreau is kind of right.  You can't send email from the website because you are getting rejected by the 365 for not having enough (tls) ecryption.  The two easy choices are instead of trying to send it directly to Microsoft:

1.  Build your own relay server with the correct encryption and authentication

2.  The easier route, contact your host or ISP and chances are they already have an address and server already set up.  Most are set up as smtp.ISP.com or something like that.
0
 

Accepted Solution

by:
PianoMover earned 0 total points
ID: 37807681
In the end I found I could send emails to myself from myself and with enablessl, it seems to work.  For replying to my customers I had to set the replytoo parameter.
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 37932312
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
Read this article to learn how to migrate data from SharePoint to SharePoint Online account. The entire process of SharePoint migration is described in detail.
how to add IIS SMTP to handle application/Scanner relays into office 365.
Watch the video to know the process of migration of Exchange or Office 365 mailboxes in absence of MS Outlook. It is an eminent tool which can easily migrate Public, Archive user mailboxes from one another Exchange server and Office 365. Kernel Migr…

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question