标题:asp表单提交到邮箱乱码问题
只看楼主
kkjunkkfen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-5-31
结帖率:0
已结贴  问题点数:0 回复次数:3 
asp表单提交到邮箱乱码问题
Dear!
公司做一个日文网站,里面写了一个邮箱提交页面,可是在测试的时候发现在邮箱里面提交过来的值乱码。
搜索更多相关主题的帖子: 日文网站 
2011-05-31 16:16
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
得分:20 
不知道你用什么方式/组件发信的,应该是邮件的编码问题。

----我怎能在别人的苦难面前转过脸去----
2011-05-31 17:27
kkjunkkfen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-5-31
得分:0 
<%@ Language = VBScript %>
<%
action=request("action")
if action="ok" then
'==================================================
' 参数设置开始,请修改相应参数
smtpserver = "smtp. '发送邮件所使用的SMTP服务器,例如smtp.,请修改
smtpuser = "" '与SMTP服务器对应的邮箱用户名,请修改
smtppwd = "" '与SMTP服务器对应的邮箱密码,请修改
'如果SMTP服务器需要发信认证,则设置登录SMTP服务器的用户名和密码
'与相应SMTP服务器对应的邮件地址
'注意:很多SMTP服务器除了要验证用户名和密码外,还要验证发件人地
'址,比如的SMTP服务器在检查发信人邮件地址是不是以
'结尾,否则不予发送,因此,使用相应的信箱做为发信人信箱是必要的
smtpemail = ""  'SMTP服务器发信邮箱,请修改
myemail="" '用来接收邮件的邮箱,请修改,可以与SMTP服务器发信邮箱不同
' 参数设置结束
'==================================================
sendname = trim(Request("name")) '发件人名字
email = trim(Request("email")) '发件人邮箱
CompanyName = trim(Request("CompanyName"))
address = trim(Request("address"))
fax = trim(Request("fax"))
telephone = trim(Request("telephone"))
body = trim(Request("body"))
guojia = trim(Request("guojia"))
select1 = trim(Request("select"))
textfield = trim(Request("textfield"))
select22 = trim(Request("select2"))
if sendname="" or email="" or CompanyName="" or guojia=""  or select22="" then
response.write "Items with asterisks(*) must be filled! <a href=javascript:history.go(-1)>Return</a>"
response.end
end if
mailbody=mailbody &"<style>A:visited {    TEXT-DECORATION: none    }"
    mailbody=mailbody &"A:active  {    TEXT-DECORATION: none    }"
    mailbody=mailbody &"A:hover   {    TEXT-DECORATION: underline    }"
    mailbody=mailbody &"A:link       {    text-decoration: none;}"
    mailbody=mailbody &"BODY   {    FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 12pt;}"
    mailbody=mailbody &"TD       {    FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 12pt    }</style>"
    mailbody=mailbody &"<TABLE border=0 width='95%' align=center><TBODY><TR><TD>"
    mailbody=mailbody &"HELLO! I'm: "&sendname&"<br>"
    mailbody=mailbody &""&select22&"<br><br>"
    mailbody=mailbody &"Country: "&guojia&"<br><br>"
    mailbody=mailbody &"Contact: "&CompanyName&"<br><br>"
    mailbody=mailbody &"Address: "&address&"<br><br>"
    mailbody=mailbody &"Phone: "&telephone&"<br><br>"
    mailbody=mailbody &"Fax: "&fax&"<br><br>"
    mailbody=mailbody &"E-mail: "&email&"<br><br>"
    mailbody=mailbody &"How did you hear of EEMB: "&select1&"<br>"
    mailbody=mailbody &""&textfield&"<br><br>"
    mailbody=mailbody &"Message: "&body&"<br><br>"
    mailbody=mailbody &"*************************************************************************************"
    mailbody=mailbody &"<br>此邮件由<a href=http:// target=_blank>EEMB</a>在线邮件系统发送,请勿直接回复此邮件!<br>"
    mailbody=mailbody &"该邮件的发件人为"&sendname&"&nbsp;&nbsp;发件人邮箱为"&email&"<br>"
    mailbody=mailbody &"如果需要回复,请发邮件至"&email&",谢谢! <br>"
    mailbody=mailbody &"*************************************************************************************"   
    mailbody=mailbody &"</TD></TR></TBODY></TABLE>"
if sendname <> "" and email <> "" then

set jmail= server.CreateObject ("jmail.message")
jmail.Silent = true
jmail.Charset = "gb2312"
JMail.ContentType = "text/html"

jmail.From = smtpemail
jmail.FromName = sendname
jmail.ReplyTo = email
jmail.Subject = CompanyName
jmail.AddRecipient myemail
jmail.Body = mailbody
jmail.MailServerUserName = smtpuser
jmail.MailServerPassWord = smtppwd

isgo = jmail.Send(smtpserver)
if isgo then
msg=" "
else
msg = " "
end if

jmail.Close
set jmail = nothing
end if
end if
%>


<%if msg<>"" then%>
<br><%=msg%><span class="STYLE24"><span class="STYLE40">Sent successfully!<img src="imagess/gou.jpg" width="23" height="24" vspace="5">Thank you for contacting EEMB BATTERY through our contact form.  You should receive a response within 24 hours, excluding weekends.</span><a href="javascript:history.go(-1)"><strong><em>Return</em></strong></a></span>
<%else%>
<form action="contactus.asp" method=post>
  <table cellpadding="2" cellspacing="1" width="668">
  <input type="hidden" name="action" value="ok">
   <tr>
      <td width="134" class=forumrow STYLE24><span class="STYLE5">Contact</span><font color=#ff0000>*</font></td>
      <td width="453" colspan="3" class=forumrow><select name="select2">
        <option>Mr</option>
        <option>Ms</option>
      </select>
      <input name=name type=text id="name" size=24>
        <label></label>
        </span></td>
    </tr>
    <tr>
      <td width="134" class=forumrow STYLE24><span class="STYLE5">Country</span><font color=#ff0000>*</font></td>
      <td colspan="3" class=forumrow><input type=text name=guojia size=30></td>
    </tr>
        <tr>
      <td width="134" class=forumrow STYLE24><span class="STYLE5">The company name</span><font color=#ff0000>*</font></td>
      <td colspan="3" class=forumrow><input type=text name=CompanyName size=30></td>
    </tr>
            <tr>
      <td width="134" class=forumrow STYLE24>Address</td>
      <td colspan="3" class=forumrow><input type=text name=address size=30></td>
    </tr>
            <tr>
      <td width="134" class=forumrow STYLE24>Phone</td>
      <td colspan="3" class=forumrow><input type=text name=telephone size=30></td>
    </tr>
            <tr>
      <td width="134" class=forumrow STYLE24>Fax</td>
      <td colspan="3" class=forumrow><input type=text name=fax size=30></td>
    </tr>
    <tr>
      <td width="134" class=forumrow STYLE24><span class="STYLE5">E-mail</span><font color=#ff0000>*</font></td>
      <td colspan="3" class=forumrow><input name=email type=text id="email" size=30></td>
    </tr>
    <tr>
      <td width="134" class=forumrow STYLE24>How did you hear of EEMB<span class="STYLE6">*</span></td>
      <td colspan="3" class=forumrow><select name="select">
                                      <option selected="selected">---Please select---</option>
                                      <option>Google Search</option>
                                      <option>Google Sponsored Links</option>
                                      <option>Globlespec</option>
                                      <option>Sourceguide</option>
                                      <option>Interfacebus</option>
                                      <option>Alibaba</option>
                                      <option>Globalsource</option>
                                      <option>Yahoo</option>
                                      <option>Others (Please specify)</option>
                                    </select>
                                    <label>
                                    <input type="text" name="textfield">
                                    </label>&nbsp;</td>
    </tr>
    <tr>
      <td width="134" class=forumrow STYLE24>Message</td>
      <td colspan="3" class=forumrow><textarea name="body" cols=50 rows=6 id="body"></textarea></td>
    </tr>
    <tr>
      <td width="134" class=forumrow></td>
      <td height=20 colspan="3" class=forumrow>
        <input type="Submit" value="Submit information" name="Submit">
&nbsp;
        <input type="reset" name="Clear" value="Empty"><br>
        <span class="STYLE24">Items with asterisks(<span class="STYLE6">*</span>) must be filled! </span></td>
    </tr>
  </table>
</form><%end if%>

2011-06-01 09:41
kkjunkkfen
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-5-31
得分:0 
需要在发到邮箱前把提交过来的值转码吗?怎么转呢?
2011-06-01 09:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-341517-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.105701 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved