Send Attachments with Amazon-SES

前端 未结 7 866
没有蜡笔的小新
没有蜡笔的小新 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:47

    I think you need to follow the instructions on this link. Amazon doesn't let you add attachments or other more complicated message types (iCalendar events). Essentially you need to handcraft the message body by string building and manipulation.

    Currently I do this for iCalendar format emails on a legacy system. It's a bit of a pain in the ass, but if you read RFC 2822, it tells you pretty clearly what the format is. Special things to pay attention to:

    • Base64 encoding of the data
    • MIME types
    • Make sure your multipart boundaries match up (and are unique)
    • Finicky problems with the number of line breaks (\n) after certain lines

    Best of luck. I don't know if there is an open library that will do this sort of thing for you in C#. If you can find one then try use it, because dealing with the intricacies of the RFC should have a medical notice for increased blood pressure and hair loss.

提交回复
热议问题