Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > ASP > ASP Forum > ช่วยด้วยครับหมดปัญญาแล้วส่งเมล์แล้วเป็นภาษาต่างดาว????????????ต้องแก้ตรงไหน



 

ช่วยด้วยครับหมดปัญญาแล้วส่งเมล์แล้วเป็นภาษาต่างดาว????????????ต้องแก้ตรงไหน

 



Topic : 058742



โพสกระทู้ ( 2 )
บทความ ( 0 )



สถานะออฟไลน์




Code (ASP)
<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit %>
<% Response.Buffer = True %>
<%



'Declaring Variables
Dim smtpserver,youremail,yourpassword,ContactUs_Name,ContactUs_Email
Dim ContactUs_Subject,ContactUs_Body,Action,IsError, ContactUs_Company, ContactUs_Phone

' Edit line 11 accordingly
smtpserver = "mail.xxxxx.com"
youremail = "xxxxxx"
yourpassword = "xxxxxxxxxx"

' Grabbing variables from the form post
ContactUs_Email = Request("ContactUs_Email")
ContactUs_Company = Request("ContactUs_Company")
ContactUs_Name = Request("ContactUs_Name")
ContactUs_Phone = Request("ContactUs_Phone")
ContactUs_Subject = Request("ContactUs_Subject")
ContactUs_Body = Request("ContactUs_Body")
Action = Request("Action")


' Used to check that the email entered is in a valid format
Function IsValidEmail(Email)
	Dim ValidFlag,BadFlag,atCount,atLoop,SpecialFlag,UserName,DomainName,atChr,tAry1
	ValidFlag = False
		If (Email <> "") And (InStr(1, Email, "@") > 0) And (InStr(1, Email, ".") > 0) Then
			atCount = 0
			SpecialFlag = False
			For atLoop = 1 To Len(Email)
			atChr = Mid(Email, atLoop, 1)
				If atChr = "@" Then atCount = atCount + 1
				If (atChr >= Chr(32)) And (atChr <= Chr(44)) Then SpecialFlag = True
				If (atChr = Chr(47)) Or (atChr = Chr(96)) Or (atChr >= Chr(123)) Then SpecialFlag = True
				If (atChr >= Chr(58)) And (atChr <= Chr(63)) Then SpecialFlag = True
				If (atChr >= Chr(91)) And (atChr <= Chr(94)) Then SpecialFlag = True
			Next
			If (atCount = 1) And (SpecialFlag = False) Then
				BadFlag = False
				tAry1 = Split(Email, "@")
				UserName = tAry1(0)
				DomainName = tAry1(1)
			If (UserName = "") Or (DomainName = "") Then BadFlag = True
			If Mid(DomainName, 1, 1) = "." then BadFlag = True
			If Mid(DomainName, Len(DomainName), 1) = "." then BadFlag = True
				ValidFlag = True
			End If
		End If
		If BadFlag = True Then ValidFlag = False
		IsValidEmail = ValidFlag
End Function
%>

<html>

<head>
<title>Contact Ayers Welldrilling</title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel=stylesheet type="text/css" href="../../include/stylesheet.css">

<body style="font-family: Arial; font-size: 12px;">

<%
If Action = "SendEmail" Then

	' Here we quickly check/validate the information entered
	' These checks could easily be improved to look for more things
	If IsValidEmail(ContactUs_Email) = "False" Then
		IsError = "Yes"
		Response.Write("<font color=""red"">You did not enter a valid email address.</font><br>")
	End If

	If ContactUs_Name = "" Then
		IsError = "Yes"
		Response.Write("<font color=""red"">You did not enter a Name.</font><br>")
	End If


	If ContactUs_Phone = "" Then
		IsError = "Yes"
		Response.Write("<font color=""red"">You did not enter a Phone.</font><br>")
	End If

	If ContactUs_Subject = "" Then
	IsError = "Yes"
		Response.Write("<font color=""red"">You did not enter a Subject.</font><br>")
	End If

	If ContactUs_Body = "" Then
		IsError = "Yes"
		Response.Write("<font color=""red"">You did not enter a Body.</font><br>")
	End If

End If

' If there were no input errors and the action of the form is "SendEMail" we send the email off
If Action = "SendEmail" And IsError <> "Yes" Then

	Dim strBody

	' Here we create a nice looking html body for the email
	strBody = strBody & "<font face=""Verdana,Geneva,Arial,Helvetica,sans-serif"">Here we create" & vbCrlf & "Submitted at: " & Now() &  vbCrLf & "<br><br>"
	'strBody = strBody & "From http://" & Request.ServerVariables("HTTP_HOST") &  vbCrLf & "<br>"
	'strBody = strBody & "IP " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf & "<br>"
	strBody = strBody & "Company" & ":  " & " " & Replace(ContactUs_Company,vbCr,"<br>") & "<br>"
	strBody = strBody & "Phone" & ":    " & " " & Replace(ContactUs_Phone,vbCr,"<br>") & "<br>"
	strBody = strBody & "Name" & ":     " & " " & Replace(ContactUs_Name,vbCr,"<br>") & "<br>"
	strBody = strBody & "Email" & ":    " & " " & Replace(ContactUs_Email,vbCr,"<br>") & "<br>"
	strBody = strBody & "Subject" & ":  " & " " & Replace(ContactUs_Subject,vbCr,"<br>") & "<br>"
	strBody = strBody & "<br>" & Replace(ContactUs_Body,vbCr,"<br>") & "<br>"
	strBody = strBody & "</font>"

	Dim ObjSendMail
	Set ObjSendMail = CreateObject("CDO.Message")

	'This section provides the configuration information for the remote SMTP server.

	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = youremail
	ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourpassword

	ObjSendMail.Configuration.Fields.Update

	'End remote SMTP server configuration section==

	ObjSendMail.To = youremail
	ObjSendMail.Subject = ContactUs_Subject
	ObjSendMail.From = ContactUs_Email

	' we are sending a html email.. simply switch the comments around to send a text email instead
	ObjSendMail.HTMLBody = strBody
	'ObjSendMail.TextBody = strBody

	ObjSendMail.Send

	Set ObjSendMail = Nothing

' Change the success messages below to say or do whatever you like
' You could do a response, a redirect, or offer a hyperlink somewhere.. etc etc
%>
<div align="center"><center>
<table width="540" border="0"><tr><td><p>

<img src="Desktop/ayers-logo.jpg" alt="Ayers Logo" width="307" height="75" border="0">
<p>&nbsp;<br>

<font size="2" color="#0000FF"> Message Subject: &nbsp;&nbsp; <% =Replace(ContactUs_Subject,vbCr,"<br>") %></font>
</p>

<p>&nbsp;<br>
<b>Your message has been sent to Ayers Welldrilling - Thank You.</b></font>
<font face="Verdana,Geneva,Arial,Helvetica,sans-serif" size="2"><br>&nbsp;<br>&nbsp;
<br>Please allow a couple days for response.
<br>If your message is more urgent, call 440-256-3622
</font>
</p>

</td></tr></table>
<p>&nbsp;<br>
<a href="index.html" title="Home">
Home
</a>
</p>
</div>
<% Else %>

<div align="center"><center>
<table width="540" border="0"><tr><td><p>
<font face="Arial, helvetica" size="5" color="#000000">
<img src="fush/Desktop/ayers-logo.jpg" alt="Ayers Logo" width="307" height="75" border="0">
<p>
<b>Information Request and Comments</b></font>

<p><font FACE="Arial, helvetica" Size=2>
We are interested in your comments, information requests, etc...
<br>Please allow a couple days for response.
</td></tr></table>


<form action="contact_us.asp" method="POST">
<input type="hidden" name="Action" value="SendEmail">


	<table width="540" border="0">
	<tr><td colspan="2">
		<font FACE="Arial" size="2">
		The information below is confidential and will not be distributed.</font>
		<hr></td>
	</tr>

	<tr><td width="150"><font FACE="Arial" size="2"><b>*Name:</b></font></td>
		<td>
		<input type="text" name="ContactUs_Name" size="35" value="<% =ContactUs_Name %>">
</td>
	</tr>
	<tr><td width="150"><font FACE="Arial" size="2"><b>Company:</b></font></td>
		<td>
		<input type="text" name="ContactUs_Company" size="35" value="<% =ContactUs_Company %>">
	</tr>
	<tr><td width="150"><font FACE="Arial" size="2"><b>*Phone:</b></font></td>
		<td>
		<input type="text" name="ContactUs_Phone" size="35" value="<% =ContactUs_Phone %>">
         </td>
	</tr>
    <tr><td><font FACE="Arial" size="2"><b>*E-mail:</b></font></td>
        <td>
		<input type="text" name="ContactUs_Email" size="35" value="<% =ContactUs_Email %>">
		</td>
    </tr>


    <tr><td><font FACE="Arial" size="2"><b>*Subject:</b></font></td>
        <td>
		<input type="text" name="ContactUs_Subject" value="<% =ContactUs_Subject %>" size="35">
		</td>
    </tr>

      <tr><td valign="top"><font FACE="Arial" size="2"><b>*Comments:</b></font></td>
  		<td>
		<textarea cols="40" rows="10" name="ContactUs_Body"><% =ContactUs_Body %></textarea>
		</td>
    </tr>

         <tr><td colspan="2"><font FACE="Arial" size="2"><b>*</b>Required</font></td>
    </tr>

    <tr>
		<td>&nbsp;</td>
		<td>
			<font FACE="Arial" size="3">
				<input TYPE="submit" NAME="Engage" VALUE="Send Message" tabindex="15">&nbsp;
				<input TYPE="reset" VALUE="Reset" name="B2" tabindex="16">
			
				<b>&nbsp;&nbsp;Thank you!</b></font>

		</td>
	</tr>
</table>

</form>

<p><font face="Arial" size="2"><a href="index.html">Home</a></font>
</center></div>

<% End If %>

</body>

</html>




Tag : ASP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-04-18 01:28:05 By : rush3789 View : 1808 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code (ASP)
<%
ObjSendMail.BodyPart.Charset = "TIS-620" 
%>


ถ้า CDO ให้ใช้ .BodyPart.Charset = "TIS-620" ครับ


Go to : asp ส่งเมลแบบ CDO.Message แต่ไม่เป็นภาษาไทย กลายเป็นภาษาต่างดาว หรือ ?






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-04-18 09:02:10 By : webmaster
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยด้วยครับหมดปัญญาแล้วส่งเมล์แล้วเป็นภาษาต่างดาว????????????ต้องแก้ตรงไหน
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่