Solved

asp.net to Office 365 smtp relay

Posted on 2011-09-25
8
2,062 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
8 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 69

Expert Comment

by:Éric Moreau
ID: 36936102
0
Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now