|
 |
|
ขอวิธีแก้ พอดีส่งอีเมลออก ด้วยภาษาไทยแต่กลายเป็น ????? เมื่อได้รับอีเมล รบกวนช่วยทีครับ |
|
 |
|
|
 |
 |
|
Code (C#)
using System;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.Configuration;
using System.Web.Mail;
public partial class KACEEBEST : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSend_Click(object sender, EventArgs e)
{
MailMessage myMail = new MailMessage();
myMail.BodyFormat = MailFormat.Html;
myMail.BodyEncoding = MailEncoding.
myMail.To = "[email protected]";
myMail.From = "<" + this.txtFromEmail.Text.ToString() + ">" + this.txtFromName.Text.ToString();
myMail.Bcc = this.txtFromEmail.Text;
myMail.Subject = "Thank for Subscribe KACEE ขอบคุณครับ";
myMail.Body = "Subscribe E-Newsletter From Website www.kaceebest.com ขอบคุณครับ";
SmtpMail.Send(myMail);
string strSMTP = "mail.kaceebest.com";
string cdoSendUsingPort = "2";
string cdoBasic = "1";
string UserName = "[email protected]";
string Password = "password";
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", strSMTP);
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", UserName);
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", Password);
SmtpMail.SmtpServer = strSMTP;
SmtpMail.Send(myMail);
myMail = null;
Page.ClientScript.RegisterStartupScript(Page.GetType(), "testAlert", "<script language=javascript>alert('Send Mail Complete');</script>");
}
}
|
 |
 |
 |
 |
Date :
2014-06-16 17:00:02 |
By :
emotionsizes |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (C#)
message.BodyEncoding = System.Text.Encoding.UTF8;
ส่วนพวก Subject หรือ Form ให้ใส่ ?utf-8?B ครับ
Code (C#)
string strSubject = "=?UTF-8?B?".base64_encode("ส่งอีเมล์ภาษาไทย ด้วย php ทดสอบชื่อเรื่องภาษาไทย")."?=";
ตรง Form ก็เหมือนกัน
|
 |
 |
 |
 |
Date :
2014-06-17 06:34:07 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|