SpreadWebServcie.SendSimpleAttachment Method

Send transactional email with 1 attachment.

Note: The contact will be automatically added to the contact list named "Auto_ + Current Date".This function allows duplicate sending, so the contact list may contains duplicate email.Do not use this contact list in other campaigns, if you want to avoid duplicate sending.

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

)

Parameters

Parameter

Type

Description

LoginEmail

String

The login email of your Spread account.

Password

String

The password of your Spread accountAPI Keywhich you can retrieve from your Spread account (My account=> Settings).

CampaignName

String

The name of the email campaign.

From

String

The email address of sender.

FromName

String

The name of sender.

To

String

The email address of recipient.

replyTo

String

The reply email address

Subject

String

The subject of the campaign.

Body

String

The content of the campaign. Support plain text or HTML tag

Attachment

Byte[]

The attachment file stream(byte array forms)

AttachmentName

String

Attachment display name (include extensions,for example 'file.zip')

Return Value

String represent the result of send status ."Sent success" means success,others fail

Example

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);

^