إرسال بريد إلكتروني جماعي باستخدام C Sharp
إرسال بريد إلكتروني جماعي إلى مجموعة من عنوان البريد الإلكتروني مع C Sharp
C Sharp : وثائق API
- إنشاء مجموعة باستخدام C Sharp
- الحصول على قائمة حقول المجموعة باستخدام C Sharp
- إضافة حقل إلى مجموعة بها C Sharp
- حذف حقل من مجموعة بها C Sharp
- حذف جهة اتصال من مجموعة
- عيّن البلد إلى مجموعة بها C Sharp
- الحصول على قائمة جهات اتصال المجموعة باستخدام C Sharp
- إضافة جهة اتصال إلى مجموعة بها C Sharp
- تعديل جهة اتصال مجموعة بها C Sharp
- حذف جهة اتصال لمجموعة بها C Sharp
إرسال بريد إلكتروني جماعي باستخدام C Sharp
String afilnet_class="email";
String afilnet_method="sendemailtogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_subject="Afilnet - Test email";
String afilnet_idgroup="1";
String afilnet_email="Afilnet - Test email";
String afilnet_scheduledatetime="";
String afilnet_output="";
// Create an URL request
WebRequest request = WebRequest.Create("https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&subject="+afilnet_subject+"&idgroup="+afilnet_idgroup+"&email="+afilnet_email+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output);
// Get the response
WebResponse response = request.GetResponse ();
// Get the stream returned by the server
Stream dataStream = response.GetResponseStream();
// Open the stream
StreamReader reader = new StreamReader (dataStream);
// Read the Response
String result = reader.ReadToEnd ();
// Asign vars
var data = new NameValueCollection();
data["class"] = "email";
data["method"] = "sendemailtogroup";
data["user"] = "user";
data["password"] = "password";
data["subject"] = "Afilnet - Test email";
data["idgroup"] = "1";
data["email"] = "Afilnet - Test email";
data["scheduledatetime"] = "";
data["output"] = "";
// Create Web client
var wb = new WebClient();
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/http/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
// Asign vars
var data = new NameValueCollection();
data["class"] = "email";
data["method"] = "sendemailtogroup";
data["subject"] = "Afilnet - Test email";
data["idgroup"] = "1";
data["email"] = "Afilnet - Test email";
data["scheduledatetime"] = "";
data["output"] = "";
// Create Web client
var wb = new WebClient { Credentials = new NetworkCredential("user", "password") };
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/http/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="email";
String afilnet_method="sendemailtogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_subject="Afilnet - Test email";
String afilnet_idgroup="1";
String afilnet_email="Afilnet - Test email";
String afilnet_scheduledatetime="";
String afilnet_output="";
// Allow SSL/TLS config
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// We create the webservice instance (Register Web Service first in project)
var service = new WebService.ApplicationServicesPortTypeClient();
// Call to WebService method
String response = service.call(afilnet_user, afilnet_password, afilnet_class, afilnet_method, "{\"subject\":\""+afilnet_subject+"\",\"idgroup\":\""+afilnet_idgroup+"\",\"email\":\""+afilnet_email+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"output\":\""+afilnet_output+"\"}");
معامل | وصف | إجباري / اختياري |
---|---|---|
class=email | الفئة المطلوبة: الفئة التي تم تقديم الطلب إليها | إلزامي |
method=sendemailtogroup | طريقة الفصل المطلوبة: طريقة الفصل الذي تم تقديم الطلب إليه | إلزامي |
user | المستخدم والبريد الإلكتروني لحساب Afilnet الخاص بك | إلزامي |
password | كلمة المرور لحساب Afilnet الخاص بك | إلزامي |
subject | Remitente | إلزامي |
idgroup | معرف المجموعة الوجهة | إلزامي |
رسالة البريد الإلكتروني ليتم إرسالها | إلزامي | |
scheduledatetime | تاريخ التسليم والوقت بالتنسيق yyyy-mm-dd hh:mm:ss | اختياري |
output | تنسيق الإخراج من النتيجة | اختياري |
عند تقديم طلبات ، ستتلقى الحقول التالية:
- status
-
النتيجة (إذا كانت الحالة = النجاح) ، سوف تتلقى هنا القيم التالية:
- id
- count
- credits
-
destinations
- messageid
- destination
- خطأ (إذا كانت الحالة = خطأ) ، هنا ستتلقى رمز الخطأ
يتم سرد رموز الأخطاء المحتملة أدناه
الشفرة | وصف |
---|---|
MISSING_USER | المستخدم أو البريد الإلكتروني غير المدرجة |
MISSING_PASSWORD | كلمة المرور غير المدرجة |
MISSING_CLASS | الطبقة غير المدرجة |
MISSING_METHOD | طريقة غير المدرجة |
MISSING_COMPULSORY_PARAM | المعلمة الإجبارية غير المدرجة |
INCORRECT_USER_PASSWORD | مستخدم غير صحيح أو كلمة المرور |
INCORRECT_CLASS | فئة غير صحيحة |
INCORRECT_METHOD | طريقة غير صحيحة |
NOT_ACCESS_TO_GROUP | غير مسموح لك بالدخول إلى المجموعة المشار إليها |
NO_CREDITS | رصيدك غير كافٍ |
المعلمات:
- class : email
- method : sendemailtogroup
- user : user
- password : password
- subject : Afilnet - Test email
- idgroup : 1
- email : Afilnet - Test email
- scheduledatetime :
- output :
طلب:
https://www.afilnet.com/api/http/?class=email&method=sendemailtogroup&user=user&password=password&subject=Afilnet - Test email&idgroup=1&email=Afilnet - Test email&scheduledatetime=&output=