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

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:
主站蜘蛛池模板: 个旧市| 五寨县| 灌南县| 北宁市| 文水县| 诸城市| 清徐县| 翼城县| 丰台区| 泸西县| 依安县| 宣化县| 鸡泽县| 黑水县| 资溪县| 霍州市| 札达县| 乐山市| 龙门县| 芜湖市| 贡山| 如东县| 大冶市| 南岸区| 布尔津县| 建昌县| 聊城市| 获嘉县| 贵州省| 石屏县| 宾川县| 巫山县| 垫江县| 历史| 灯塔市| 泰来县| 新乐市| 泽普县| 卓尼县| 巴东县| 中卫市|