Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Cowling 142 posts 340 karma points
    May 07, 2014 @ 10:41
    Tom Cowling
    0

    Umbraco and Office365

    Hi,

    Our institution recently moved over to Office365 and I'm struggling with the mail settings and getting them to work properly.

    Previously we used to use an exchange server that was very relaxed with it's rules on what was allowed to send out and only needed the host filling in and the username and password blank.

    I've tried various settings that I've found across the internet but have yet to find something that works. I'm not sure if it's down to the fact that Office365 is very strict with it's settings or I'm just doing something wrong. Also, does it go deeper than the web.config file? For example, do I need to do any additional bits in IIS at a higher level?

    Thanks in advance,

    Tom

  • Jan Skovgaard 11255 posts 23494 karma points MVP 7x admin c-trib
    May 07, 2014 @ 11:12
    Jan Skovgaard
    0

    Hi Tom

    I assume you're having issues with sending e-mail based on different workflows in Umbraco and using Contour etc.?

    Have you tried looking in the log table or the trace log in /app_data/logs (if you're running Umbraco 4.10+)?

    /Jan

  • Tom Cowling 142 posts 340 karma points
    May 07, 2014 @ 12:00
    Tom Cowling
    0

    It's mostly for the send for approval stuff. It's been working great with my previous exchange server, but can't seem to get it to play nice.

    I've created a test user account that has edit rights only and has to send to publish. With my old exchange settings thrown in there, I can send a send to publish email as long as long as my email address is in the same domain (it no longer is - hence the move to office365) and it will work fine. If I put my new email address is, it is no longer in the same domaain so the log show the following error:

    2014-05-06 17:35:52,323 [17] ERROR umbraco.cms.businesslogic.workflow.Notification - [Thread 48] Error in notification
    System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'myoldexchangeserver'
    at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6)
    at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback)
    at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
    at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
    at System.Net.Mail.SmtpClient.Send(MailMessage message)
    --- End of inner exception stack trace ---
    at System.Net.Mail.SmtpClient.Send(MailMessage message)
    at umbraco.cms.businesslogic.workflow.Notification.sendNotification(User performingUser, User mailingUser, Document documentObject, IAction Action)
    at umbraco.cms.businesslogic.workflow.Notification.GetNotifications(CMSNode Node, User user, IAction Action)


    When I put what I think i the correct settings for Office 365 (below) I get a runtime error after waiting for about 2 mins for it to time out.

      <system.net>
        <mailSettings>
          <smtp>
          <network defaultCredentials="false" enableSsl="true" host="smtp.office365.com" port="587" password="******" userName="*******" />
          </smtp>
        </mailSettings>
      </system.net>

  • Jan Skovgaard 11255 posts 23494 karma points MVP 7x admin c-trib
    May 07, 2014 @ 13:13
    Jan Skovgaard
    0

    Hi Tom

    Hmm, yeah that's a tricky one.

    First of all you of course need to be sure the information you're entering in the smtp settings are correct. Second I suspect you also need to figure out whether there is a firewall blocking the traffic or something like that.

    Hope this helps.

    /Jan

  • Ben Marte 13 posts 34 karma points
    Aug 04, 2014 @ 16:37
    Ben Marte
    1

    I ran into this issue and the problem was that the email I was using in the SMTP from address in my web.config was not the same as the one that is in

    Config\umbracoSettings.config

    Specifically this line

    <notifications>
          <!-- the email that should be used as from mail when umbraco sends a notification -->
          <email>your@email.here</email>
    </notifications>

    Hopefully that is the same issue you might be having.

  • Tom Cowling 142 posts 340 karma points
    Aug 04, 2014 @ 16:52
    Tom Cowling
    0

    Interesting - thanks a lot Ben. I'll take a look.

     

  • Ali Robertson 9 posts 104 karma points
    Jul 06, 2016 @ 05:20
    Ali Robertson
    1

    Hello, I have just set this up and thought I would share my configuration:

    1. Set umbracoSettings.config email to the email you wish to use.
    2. Create an Email.config file that looks something like this (if you are using source control, exclude this file - include a EmailTemplate.config.txt file with dummy credentials):

    <?xml version="1.0"?> <smtp from="myemail@mydomain.com"> <network host="smtp.office365.com" password="ACCOUNTPASSWORD" port="587" userName="myemail@mydomain.com" clientDomain="mydomain.com" enableSsl="true" /> </smtp>

    1. In web.config, ensure the mailSettings look something like this:

    <system.net> <mailSettings> <smtp configSource="Email.config"></smtp> </mailSettings> </system.net>

    Note: make sure your password is valid in XML (i.e. does not contain <, >, etc). Ensure the Office 365 account you use is locked down and has no password expiry. Web servers are a common attack vector, so for security reasons, think about how far you could get into your company data with this account, and restrict it as much as possible... Before configuring this, log in to OWA for the service account, set the timezone for the user, and configure forwarding for replies. Note that sent mail will not show up in your outbox owing to how SMTP works. To test your account details, you can use the powershell Send-MailMessage, which has the same parameters and uses the same SMTP mechanism in Windows as this.

    Update: This turned out to be quite slow. Windows server mail drop + pickup directory is faster, and as a general note, it might be worth using something like SendGrid (Azure or Direct) or Mandrill (if you have Mailchimp).

Please Sign in or register to post replies

Write your reply to:

Draft