开发者

JavaMail to send email out which server?

开发者 https://www.devze.com 2023-03-29 00:58 出处:网络
Here is my issue, I\'m creating a website with a little login and resetting password. It\'s basic stuff, when user forget the password they can click the link and my applicatio开发者_如何学Gon will se

Here is my issue, I'm creating a website with a little login and resetting password. It's basic stuff, when user forget the password they can click the link and my applicatio开发者_如何学Gon will send an email with a link to reset the password. Now, I'm using Google App to send/receive email so I created a new alias like noreply@company.com.

And I just got a confirm email from Google that I'm not allowed to use Google Server to send out email by JavaMail, because they do not support JavaMail as a mail client, the issue that I'm having is I'm getting AuthenticationException back from smtp.google.com.

Moreover, I'm using Amazon EC2 to host the application as well, and amazon provides SES service to send out emails. So, the question would be can I use Google App to host our company email for every employee, but can I still use Amazon SES to send out emails by JavaMail within the same domain name as we are using with Google Apps?. So, the emails that we'll be sending out would be noreply@company.com but will be from Amazon SES.

I'm not sure if I'm making this clear enough, my concern would be we redirect email MX Record to Google App already, I think we cannot redirect to Google and Amazon at the same time?

The application we are writing is based on Grails, so the email would be from Spring Email

Cheers,


Based on my usage of Amazon SES, you should be able to use the configuration you are suggesting without any issues. You do not need to add/change any MX record when using SES, because SES does not allow you to receive emails. It is only a service for sending (relaying) email messages, i.e., as far as I understood your needs, it will serve you perfectly, and your source email address will be the same as you use today.

When you sign up for SES and want to start sending test messages, you need to verify your source and destination email addresses before actually sending emails. You can achieve this verification through either scripting (ses-verify-email-address.pl) or API (VerifyEmailAddress on AWS SDK). After sending the verification request, you should receive an email address on the verified account. Just follow the message instructions and you can safely send some test messages.

When you are satisfied with your testing, you should request production access, and after this step, you no longer need to perform verification on destination e-mail addresses.

In order to call the API, I think you can use the AWS SDK for Java without problems in your application.

See more on:
http://aws.amazon.com/ses/
http://aws.amazon.com/sdkforjava/

0

精彩评论

暂无评论...
验证码 换一张
取 消