SendEmailWithFileIds
Interface Function
Send email with attachment by the file ids.
Request Parameter
| Parameter | Required | Type | Remarks |
|---|---|---|---|
| emailArg | Yes | EmailArg | Email base arguments |
| attachmentFileIds | No | String[] | The attachment file ids. |
EmailArg Parameter
| Parameter | Type | Remarks |
|---|---|---|
| To | String[] | Email receiver group, e.g: ["test1@pwc.com,test2@pwc.com","test3@pwc.com"] |
| Group | String | Reserved |
| From | String | Email sender |
| ReplyTo | String | Email reply to |
| Cc | String | Email copy to |
| Bcc | String | Email blind copy to |
| Subject | String | Email subject |
| Content | String | Email content |
| SubmitBy | String | Reserved |
public class EmailArg
{
public string[] To { get; set; }
public string Group { get; set; }
public string From { get; set; }
public string ReplyTo { get; set; }
public string Cc { get; set; }
public string Bcc { get; set; }
public string Subject { get; set; }
public string Content { get; set; }
public string SubmitBy { get; set; }
}
Return Data Type(Data)
Success: it's true if success, or false if fail.
Message: the value will not be empty if error occurs, it shows the error message.
Data (Dictionary
): Key is the item value in the To property of the input argument EmailArg, Value means whether the mail is sent successfully or not.
public class ResultMsg<EmailArg>
{
public bool Success { get; set; }
public string Message { get; set; }
public Dictionary<string, bool> Data { get; set; }
}
Code example
var attachmengFileIds = new [] { "7b2e1cb9-5ecd-46e2-abef-494eb11c2554" };
var emailArg = new EmailArg()
{
To = new [] { "eason.y.yu@cn.pwc.com,eason.test@cn.pwc.com" },
Subject = "Test",
Content = "This is test content..."
};
var result = Service.SendEmailWithFileIds(emailArg, attachmengFileIds);
Service.ConsoleLog("SendEmailWithFileIds result", result);