Html語法,放在<BODY></BODY>裡面:


<form method="POST" action="test.asp">
 <table width="100%" border="1">
 <tr>
<td style="width:20%">寄件者姓名:</td>
<td style="width:80%"><input type="text" name="SenderName" size="20"></td>
</tr>
 <tr>
<td style="width:20%">寄件者信箱:</td>
<td style="width:80%"><input type="text" name="SenderMail" size="20"></td>
</tr>
<tr>
<td style="width:20%">收件者信箱1:</td>
<td style="width:80%"><input type="text" name="Recipient1" size="20"></td>
</tr>
<tr>
<td>收件者信箱2:</td>
<td><input type="text" name="Recipient2" size="20"></td>
</tr>
<tr>
<td valign="top">請輸入信件內容:</td>
<td><textarea rows="10" name="Body" cols="50"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="送出" name="B1"></td>
<td>12</td>
</tr>
</table>
</form>
//=====================================================================

test.asp的語法


<%
dim myMail
Set myMail=CreateObject("CDO.Message")
Dim reTotal ' 宣告自己需要的東西
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP伺服器"
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = port
'Authentication method, ssl or not, Username and password for the SMTP Server
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "完整帳號"
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "密碼"
'-------------------------------------
myMail.Configuration.Fields.Update
myMail.BodyPart.Charset = "Big5" '若寄出信件會變亂碼,請加上
myMail.From = "寄件人mail"
myMail.To = "收件人mail"
myMail.Subject = "主旨"
myMail.HTMLBody = "含html的內文"
myMail.AddAttachment "檔案名稱" '若要附加檔案
myMail.TextBody = ""
myMail.Send
set myMail = Nothing
%>

arrow
arrow
    全站熱搜

    雪貓寶寶 發表在 痞客邦 留言(0) 人氣()