4
votes

I have deployed Orchard on azure and enable Email Messaging module. Enabling says it enables successfully and asks for email settings. I provided it the mail server setting. Strange thing is, User setting does not show me the settings which are dependent on email messaging module (Contact us email address and public site name) and does not show me ("Lost your password") link . Also I have built a module which sends email. This module is not sending email.

Same orchard package works fine and also email on my dev server with same mail server settngs(gmail smtp settings.) But email is not working on azure.

What am i Missing ?

thanx

4

4 Answers

3
votes

Just FYI for anyone else who visits this Question, I just got this working from Azure using the gmail SMTP server without any third party add-ons. I simply added the following SMTP details:

enter image description here

Then used the contact form to send an email to myself. The first email gives me an alert to my gmail account:

Hi Simon, 

Someone recently tried to use an application to sign in to your Google Account - [email protected]. 

We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt: 

Monday, April 8, 2013 9:33:46 PM UTC 
IP Address: 65.52.168.70 
Location: United States

...blah blah blah

If this was you, and you are having trouble accessing your account, complete the troubleshooting steps listed at http://support.google.com/mail?p=client_login 

Following the link give you the option to allow an application to login with your credentials. Just follow the link in step 3 and then you have 10 minutes to send another email from your orchard site. The next test message I received without issue.

2
votes

Got it. Windows Azure itself does not allow sending email neither it allows to use SMTP. WE have to use third party email service like PostMark,SendGrid etc

http://blogs.msdn.com/b/publicsector/archive/2011/10/14/sending-and-receiving-email-in-windows-azure.aspx

0
votes

So, I'm just curious how does WordPress, installed on Windows Azure (gallery), able to send emails?

http://coffee2code.com/wp-plugins/configure-smtp/

0
votes

There are still too many different suggestions on the subject so i thought i should write what I've found useful. Here's what i did to get it to work:

My SMTP settings:

Sender address: [email protected]

Hostname: [email protected]

Port: 587 (25 will also do)

SSL Communications: Checked

Credentials: My Gmail address and my password

These settings should work on your local environment just fine. But on the cloud you may need to do the following:

As your Azure VM may be at some arbitrary location, Gmail marks the login attempts as suspicious and blocks them. If this is the case, you should see a mail informing you about this suspicious activity in your inbox. Just follow the instructions there and mark the login as trusted. It will remain that way until somehow your IP on the cloud changes (e.g. deleting your deployment slot). VM relocation shouldn't be an issue since the IP still remains the same. You may have to do this separately for your staging and production slots.

Lastly, I enabled full trust for my web role as shown here: http://blogs.msdn.com/b/windowsazure/archive/2009/03/18/hosting-roles-under-net-full-trust.aspx

I hope this helps others having this problem.

Cheers