Skip Navigation Links.
展开 最小化

SpreadWebServcie.Send2 Method

指定郵件活動的名稱一對一的發送郵件.

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

public String Send2 (

string LoginEmail,

string Password,

string CampaignName,

string From,

string FromName,

string To,

string Subject,

string Body

)

Public function Send2( _

LoginEmail As String, _

Password As String, _

CampaignName As String,_

From As string, _

FromName As String, _

To As String, _

Subject As String, _

Body As String _

) As String

No sample for PHP.
No sample.

參數

參數

類型

描述

LoginEmail

String

Spread賬號的郵件地址

Password

String

Spread賬號的密碼或者 API Key.

CampaignName

String

被發送郵件的名稱

From

String

發送者的郵件地址

FromName

String

發送者的名稱.

To

String

收件者的郵箱地址.

Subject

String

郵件的主題.

Body

String

郵件内容. 純文本或帶HTML標簽的文本都可以

返回結果

String  表示郵件的發送狀態.

Please find the details for the return message in the following table.

Status/Situation

Retrun Type

Retrun Message

Call API successfully and the email has been sent out.

String

Sent success

Call API with empty value of "LoginEmail" or "Password".
String

LoginEmail or Password is null

Call API with empty value of "FromName", "Subject " or "Body". String

Information requried

Call API with invalid "From" or "To". String

Invalid Email Address

Call API with invalid "LoginEmail" or "Password". String

LoginEmail and Password do not match

Your account is expired. Or you have no credit in your account. String

This user has expired or credit not enough

The daily maximum number of campaigns is 20. If you will receive the message while you create the 21st campaign in one day. String

Creation exceeded the daily maximum number of campaign.

It failed to upload the Email address and will not sent out. String

Invalid Address and Failed to Sent.

Other exceptions. Exception

Return a exception with error message.

It failed to send the email out. String

Sent failed

例子

string LoginName = "spread@reasonables.com";

string LoginPassword = "spread";

 

string CampaignName = "Noclone campaign";

 

 //Define the from infomation

string From = "myedm@edm.com";

string FromName = "Reasonable";

 

//Define recipient email

string To = "noclone@reasonables.com"; 

 

//Define the email subject and content

string Subject = "NoClone 4 is released!"; 

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

 

//Create a SpreadWebService object and use its method.

SpreadWebService MySpread = new SpreadWebService();

 

string result = MySpread.send2(LoginName,LoginPassword,CampaignName,From,FromName,To,Subject,Body);

Dim LoginName As String = "spread@reasonables.com"

Dim LoginPassword As String = "spread"

 

Dim CampaignName As String = "Noclone campaign"

 

  'Define the from infomation

Dim From As String = "myedm@edm.com"

Dim FromName As String= "Reasonable"

 

 'Define recipient email

Dim To As String= "noclone@reasonables.com"

 

 'Define the email subject and content

Dim Subject As String= "NoClone 4 is released!"

Dim Body As String= "Download NoClone 4 at http://noclone.net now!"

 

'Create a SpreadWebService object and use its method.

Dim MySpread As New SpreadWebService

Dim Result As String= MySpread.send2(LoginName, LoginPassword,CampaignName, From,FromName, To,Subject,Body)

        /**
     * @name     send2
     * @function send email one by one
     * @return
     *   'Invalid Email Address'                                            
     *   'Information required'                                             
     *   'LoginEmail and Password do not match'                             
     *   'Sent failed'                                                      
     *   'Your email has submitted successfully and will by send out soon.' 
     *   'Sent success'                                                     
     */
    public function send2($loginEmail,$assword,$actName,$from,$fromName,$toEmail,$Msubject,$Mbody){
        $sendParam = array(
            'LoginEmail'    => $loginEmail,
            'Password'      => $password,
            'CampaignName'  => empty( $actName ) ? SITE_DOMAIN.'_act_'.date( 'Y-n-j' ) : $actName,
            'From'          => $from,
            'FromName'      => $fromName,
            'To'            => $toEmail,
            'Subject'       => $Msubject,
            'Body'          => $Mbody
        );
        $Client=new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
        error_log( json_encode( $sendParam )."__param" );
        $sendResult = $Client -> Send2( $sendParam ); 
        return $sendResult;
    }
         
No sample.