官术网_书友最值得收藏!

Adding an attachment to the email

  1. 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);
  1. Let's run a test using the same request payload that we have used in the previous recipes.
  2. This is the screenshot of the email, along with the attachment:
主站蜘蛛池模板: 昭平县| 民丰县| 永州市| 读书| 南通市| 古丈县| 洪湖市| 鄂托克旗| 七台河市| 望都县| 六枝特区| 台安县| 祁东县| 三门县| 彩票| 宁波市| 禄劝| 祥云县| 漳浦县| 沁水县| 丹棱县| 江西省| 徐闻县| 武强县| 内丘县| 新泰市| 故城县| 金寨县| 益阳市| 贺州市| 邯郸县| 黑龙江省| 沙坪坝区| 葵青区| 沭阳县| 孟津县| 阜南县| 于田县| 错那县| 平顺县| 吉林省|