SpreadWebServcie.SendSimpleAttachment Method

 

一對一的發送郵件.并可携带一个附件.

注:聯系人將自動加入“Auto_+當前時間“的聯系人列表,此函數允許重複發送,所以對應名單可能會出現重複聯系人.請勿在其他郵件使用該聯系人列表,以防止郵件重複發送.

public String SendSimpleAttachment (

string LoginEmail,

string Password,

string CampaignName,

string From,

string FromName,

string To,

string replyTo,

string Subject,

string Body,

byte[] Attachment,

string AttachmentName

)

參數

參數

類型

描述

LoginEmail

String

Spread賬號的登錄郵箱.

Password

String

Spread賬號的密碼或者API Key.

CampaignName

String

活动名称.

From

String

發送者的郵箱地址.

FromName

String

發送者的名稱.

To

String

收件者的郵箱地址.

replyTo

String

回复邮件的地址.

Subject

String

郵件的主題.

Body

String

郵件的內容.

Attachment

Byte[]

附件的文件流字节数组.

AttachmentName

String

附件在邮件里面显示的名称 (比如 'file.zip')

返回結果

String  表示郵件發送的結果. ."Sent success" 表示成功,其他表示失败

例子

string LoginEmail = "spread@reasonables.com";

string LoginPassword = "spread";

string CampaignName = DateTime .Now.ToString();

 

 //Define the from infomation

string From = "myedm@edm.com";

string FromName = "Reasonable";

 

//Define recipient email

string To = "noclone@reasonables.com"; 

string replyTo = "myedm@edm.com"; 

 

//Define the email subject and body

string Subject = "NoClone 4 is released!"; 

string Body = "Download NoClone 4 at http://noclone.net now!";  

 

//Attachment infomation.

byte[] Attachment = File .ReadAllBytes( "xxxx/1234.txt" );

string AttachmentName = "1234.txt" ;

 

//Create a SpreadWebService object and use its method.

SpreadWebService MySpread = new SpreadWebService();

 

string result = MySpread.SendSimpleAttachment(LoginEmail,LoginPassword,CampaignName,

From,FromName,To,replyTo,Subject,Body,Attachment,AttachmentName);

參見

SpreadWebService Class | Spread Web Service Namespace