AppMail

AppMail

เซอร์วิสสำหรับส่งอีเมล์ รองรับ Mail Server และ Gmail

คอนฟิก appsettings

{
  "WebServiceSettings": {
    "Email": {
      "Server": "<IP_OR_DOMAIN_EMAIL>",
      "Port": 25,
      "EnableSSL": false,
      "Username": "<EMAIL>",
      "Password": "<PASSWORD>",
      "SenderAddress": "mailservice@cdg.co.th|AtlasX Support Team",
      "FromParameter": "FROM",
      "ToParameter": "TO",
      "CcParameter": "CC",
      "BccParameter": "BCC",
      "SubjectParameter": "SUBJECT",
      "BodyParameter": "BODY",
      "PriorityParameter": "PRIORITY"
    }
  }
}

Email

KeyValueDescription
ServerIP_OR_DOMAIN_EMAILเครื่อง Server ที่ให้บริการ Mail Server
Port25Port ของเครื่อง Server ที่ให้บริการ Mail Server
EnableSSLfalseระบุการเปิดใช้งาน SSL
UsernameEMAILUsername ของ Mail Server
PasswordPASSWORDPassword ของ Mail Server
SenderAddressmailservice@cdg.co.th``AtlasX Support Teamข้อความที่จะอยู่ในข้อมูลผู้ส่ง แสดงชื่อผู้ส่งด้วยการใช้เครื่องหมาย Pipe

Parameters

ParameterData TypeSample Value
FROMStringatlasx.suport@cdg.co.th
TOStringatlasx.user@cdg.co.th
CCStringatlasx.user1@cdg.co.th;atlasx.user2@cdg.co.th
BCCStringatlasx.user4@cdg.co.th;atlasx.user5@cdg.co.th
SUBJECTStringAtlasX Information
BODYStringTo AtlasX Users อีเมล ฉบับนี้ทำขึ้นเพื่อทดสอบระบบ ส่งอีเมล ด้วย
PRIORITYStringLowNormalHigh ค่าใดค่าหนึ่ง
curl --location --request POST 'https://portal-atlasx.cdg.co.th/axws-demo/api/appmail/send' \
--form 'FROM=""' \
--form 'TO="pariya.kham@gmail.com|Aui Pariya (Gmail)"' \
--form 'CC="pariya.k22@cdg.co.th|Pariya Khampimlert (GIS);pariya.demo@gmail.com;asdf.qwer@tyuio.co.th"' \
--form 'BCC="pariya-dream@hotmail.com|Aui Pariya (Hotmail)"' \
--form 'SUBJECT="AtlasX - WebService : ทดสอบส่งอีเมล"' \
--form 'BODY="<h1>AtlasX WebService</h1><p>ทดสอบนะครับ</p><p><img src=\"https://portal-atlasx.cdg.co.th/community/content/images/2019/12/devrel-in-action.jpg\"></p>"' \
--form 'PRIORITY="Normal"'

สามารถส่งไฟล์แนบได้ตามตัวอย่าง

Send E-Mail

ตัวอย่างอีเมลที่ได้รับ

Example email