您的位置:首页 > 大数据 > 人工智能

使用亚马逊邮件服务

2011-09-08 19:30 281 查看
1.  注册亚马逊的简单邮件服务

To sign up for Amazon SES

Go to http://aws.amazon.com/ses and click
Sign Up for Amazon SES.

Follow the on-screen instructions.

2.  获得亚马逊的访问令牌信息

[b]To get your AWS access identifiers
[/b]



Go to http://aws.amazon.com, click
Account, and then click Security Credentials.

Navigate to the Access Credentials section of the page, and click the
Access Keys tab.

Follow the on-screen instructions to create a new Access Key ID and Secret Access Key.

3. 验证发邮件的地址

Download
ses-verify-email-address.pl from
Amazon SES Developer Tools.




Prepare an AWS credentials file:

Create a new text file. In our example, we call it aws-credentials.

Go to the
AWS Security Credentials page and look up your Access Credentials.

Copy your Access Key ID and Secret Access Key into the
aws-credentials file.

Change the permissions on the file so that only you have read/write access. The procedure for this depends on your operating system.


Important
The preceding step is very important, because no one else should see your Secret Access Key.

Your credentials file should look similar to the following example.

AWSAccessKeyId=022QF06E7MXBSH9DHM02
AWSSecretKey=kWcrlUX5JEDGM/LtmEENI/aVmYvHNif5zB+d9+ct


Send the verification request:

Go to the directory where you downloaded ses-verify-email-address.pl.

At the command prompt, enter:

ses-verify-email-address.pl -k aws-credentials -v user@example.com



Important
Replace user@example.com with your actual email address.

Go to your email client and log in to your account. You should see a message from Amazon SES, asking you to confirm that you are the owner of this email address. When you click the link in this email, your web browser displays a confirmation page to indicate
that Amazon SES has verified your email address.

打开邮件进行验证。

5.  执行命令时会报错:  "Can't
locate XML/LibXML.pm

执行:

perl -MCPAN -e 'install Digest::SHA'

      perl -MCPAN -e 'install URI::Escape'

      perl -MCPAN -e 'install Bundle::LWP'

      perl -MCPAN -e 'install LWP::Protocol::https'

      perl -MCPAN -e 'install MIME::Base64'

      perl -MCPAN -e 'install Crypt::SSLeay'

      perl -MCPAN -e 'install XML::LibXML'

6. 还会报错: Can't locate SES.pm in @INC 

直接把  Amazon SES Developer Tools. 中的 SES.pm上传至 /usr/lib/perl 下。

7. 最后再执行 以下命令,然后进入邮件验证。

ses-verify-email-address.pl -k aws-credentials -v user@example.com


8.   最后应用aws 的 aws-java-sdk ,参照发邮件的例子,就可以发邮件了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息