Posted by : Jebastin Thursday 25 September 2014

Instead using the ASP.Net email sending code, we can use the following code to send email in Umbraco web applications.

Web.Config Configuration:

Gmail SMTP Settings:

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

Yahoo Mail SMTP Settings:

<system.net>
    <mailSettings>
      <smtp>
        <network
         host="smtp.mail.yahoo.com"
         port="465"
         userName="email@yahoo.com"
         password="password"
         defaultCredentials="false"
         enableSsl="true" />
     </smtp>
   </mailSettings>
</system.net>

Razor:

if (IsPost) {
        library.SendMail("from@email.com", "to@email.com", "Subject", "Body", false);
    }

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Link To This Post/Page

Spread The Word

Add this button to your blog:
JJ Technology Solutions

Blog Archive

Trackers

eXTReMe Tracker
facebook

- Copyright © JJ Technology Solutions - Powered by Source Code Solutions -