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

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:
主站蜘蛛池模板: 永丰县| 秦皇岛市| 西乌珠穆沁旗| 阿瓦提县| 久治县| 吉林省| 上栗县| 朝阳县| 阿克苏市| 华蓥市| 神农架林区| 金乡县| 郑州市| 溧阳市| 桃园县| 广安市| 新野县| 安塞县| 琼海市| 黎平县| 泰宁县| 申扎县| 通州市| 岳阳县| 东乡族自治县| 潼南县| 交口县| 洛扎县| 鸡泽县| 鄄城县| 巨野县| 莱州市| 正定县| 九江市| 永泰县| 盐亭县| 山丹县| 玛沁县| 吐鲁番市| 环江| 宜兰市|