
上QQ阅读APP看书,第一时间看更新
Adding an attachment to the email
- Add the following code to the Run method of the RegisterUser function:
Attachment objAttachment = new Attachment();
objAttachment.Content = System.Convert.ToBase64String
(System.Text.Encoding.UTF8.GetBytes(emailContent));
objAttachment.Filename = firstname + "_" + lastname + ".log";
message.AddAttachment(objAttachment);
- Let's run a test using the same request payload that we have used in the previous recipes.
- This is the screenshot of the email, along with the attachment:
