Send Attachments with Amazon-SES

前端 未结 7 877
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 10:06

I\'m searching for an working C# example to send attachments with Amazon-SES.

After reading that Amazon-SES now supports sending attachments I was searching for an C

7条回答
  •  死守一世寂寞
    2021-01-01 10:45

    You can setup IIS SMTP to relay through SES as well.

    You need to install stunnel and set it up

    Then you can just set the IIS SMTP Smart Host and some other options and it will relay your email through SES.

    Instructions from above linked gist:

    Instructions taken from Amazon's docs and modified as necessary.

    1. Install stunnel:

    • Download from stunnel's download page
    • Run installer w/ default options, create self signed cert by answering questions
    • Open the c:\program files (x86)\stunnel\stunnel.conf file in notepad
    • Clear all the server configs (under Example SSL server mode services section, won't have a client = yes line)
    • Create a new client config:

    [smtp-tls-wrapper]
    accept = 127.0.0.1:2525
    client = yes
    connect = email-smtp.us-east-1.amazonaws.com:465

    • Start stunnel.exe and ensure no errors are reported (you will get a little systray icon)
    • If it succeeds you can optionally install as a service, by running stunnel.exe -install at command line (note this installs the service but doesn't start it, so start it)
    • Test the connection, at cmd line run telnet localhost 2525 and you should see an SMTP response from Amazon's server (if telnet isn't installed, add the feature in Server Manager / Features / Add Feature)

    2. Configure IIS SMTP

    • Set Smart Host as [127.0.0.1] (include the brackets)
    • In the Outbound Connections section, set outgoing port to 2525 (like the stunnel.conf file)
    • In the Outbound Security section, set authentication information to your Amazon SMTP credentials, set it to basic authentication (NOTE: DO NOT CHECK THE TLS CHECKBOX)

提交回复
热议问题