简体   繁体   English

如何使用Amazon SES配置msmtp?

[英]How to configure msmtp with Amazon SES?

Amazon提供了有关postfix和sendmail的说明,但没有msmtp (简单的SMTP客户端)的说明,因此请在此处添加说明。

Install msmtp (ubuntu) 安装msmtp (ubuntu)

sudo apt-get install msmtp msmtp-mta

Configure it ( sudo nano /etc/msmtprc ): 配置它( sudo nano /etc/msmtprc ):

defaults
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
syslog on

account default
host email-smtp.us-east-1.amazonaws.com
port 587
auth on
user YOUR_AMAZON_SES_SMTP_USERNAME
password YOUR_AMAZON_SES_SMTP_PASSWORD
from YOUR_AMAZON_SES_VERIFIED_SENDER

Use it. 用它。 You don't need to set up PHP with the server info; 您无需使用服务器信息来设置PHP。 the default configuration will pass messages to sendmail, and you're good to go. 默认配置会将消息传递到sendmail,您一切顺利。

<?php

mail("user@example.com", "some subject", "some message");

?>

If you don't use PHP, you can test on the command line: 如果您不使用PHP,则可以在命令行上进行测试:

$ sendmail test-recipient@example.com
Subject: test subject

This is a test message!
^D

(The ^D means type control-D to stop typing the message and send it.) ^D表示键入control-D以停止键入消息并发送。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM