ASP (cdonts. newmail) of email)

Source: Internet
Author: User

Formmail.htm CopyCode The Code is as follows: <HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> submit a form to send an email </title>
</Head>

<Body>
<Table width = "97%" border = "1" cellspacing = "5" cellpadding = "1" align = "center" bgcolor = "# eefff4" Height = "630">
<Tr>
& Lt; TD Height = "440" & gt;
<Form action = "sendmail. asp" target = "_ blank" method = post>
<Input name = "mailto" type = hidden value = "dayechg@163.com">
<Input name = "title" type = "hidden" id = "title" value = "online booking">
<Table border = 0 cellpadding = 9 cellspacing = 0
Width = "100%">
<Tbody>
<Tr>
& Lt; TD width = "44%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff"> last name: </font> </div> </TD>
& Lt; TD width = "56%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff">
<Input name = Name>
</Font> </div> </TD>
</Tr>
<Tr>
& Lt; TD width = "44%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff"> sex: </font> </div> </TD>
& Lt; TD width = "56%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff"> male
<Input checked
Name = gender type = radio value = male>
Female
<Input name = gender
Type = radio value = female>
</Font> </div> </TD>
</Tr>
<Tr>
& Lt; TD width = "44%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff"> Age: </font> </div> </TD>
& Lt; TD width = "56%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff">
<Input name = age>
* </Font> </div> </TD>
</Tr>
<Tr>
& Lt; TD width = "44%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff"> contact number: </font> </div> </TD>
& Lt; TD width = "56%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff">
<Input name = contact number>
* </Font> </div> </TD>
</Tr>
<Tr>
& Lt; TD width = "44%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff" class = "unnamed1"> Email: </font> </div> </TD>
& Lt; TD width = "56%" & gt;
<Div align = left>
<P class = "unnamed1"> <font size = "2" color = "# 0000ff">
<Input name = Email>
* </Font> </P>
</Div> </TD>
</Tr>
<Tr>
<TD width = "44%"> <font size = "2" color = "# 0000ff"> vote: </font> </TD>
<TD width = "56%"> <font size = "2" color = "# 0000ff">
<Input name = vote id = "Vote" value = "enter details">
</Font> <font color = "# 0000ff"> </font> </TD>
</Tr>
<Tr>
& Lt; TD width = "44%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff"> Ordering: </font> </div> </TD>
& Lt; TD width = "56%" & gt;
<Div align = left> <font size = "2" color = "# 0000ff">
<Input name = ordering id = "ordering" value = "Please input details">
</Font> </div> </TD>
</Tr>
<Tr>
<TD width = "44%" class = "unnamed1"> <font color = "# 0000ff"> transportation: </font> </TD>
<TD width = "56%"> <font size = "2" color = "# 0000ff">
<Input name = vehicle ID = "vehicle ID" value = "enter details">
</Font> </TD>
</Tr>
<Tr>
<TD width = "44%" class = "unnamed1"> <font color = "# 0000ff"> housing: </font> </TD>
<TD width = "56%"> <font size = "2" color = "# 0000ff">
<Input name = Fixed room id = "fixed room" value = "Please input details">
</Font> </TD>
</Tr>
<Tr>
<TD class = "unnamed1"> <font color = "# 0000ff"> Guided Tour: </font> </TD>
<TD> <font size = "2" color = "# 0000ff">
<Input name = customized tour guide id = "customized Tour Guide" value = "Enter the conditions for your desired Tour Guide">
</Font> </TD>
</Tr>
<Tr>
<TD class = "unnamed1"> <font color = "# 0000ff"> Hotel: </font> </TD>
<TD> <font size = "2" color = "# 0000ff">
<Input name = hotel id = "hotel" value = "enter details">
</Font> </TD>
</Tr>
<Tr>
<TD colspan = 2>
<Div align = center> <font size = "2" color = "# 0000ff">
<Input name = submit type = submit value = OK>
<Input name = reset type = reset value = Cancel>
</Font> </div> </TD>
</Tr>
</Tbody>
</Table>
<P> </P>
</Form> </TD>
</Tr>
</Table>
</Body>
</Html>

Sendmail. aspCopy codeThe Code is as follows: <%
Function Sendmail (mailto, mailfrom, title, content)
'On error resume next
Dim objcdomail
Set objcdomail = server. Createobject ("cdonts. newmail ")
With objcdomail
. From = mailfrom
. To = mailto
. Subject = title
. Body = content
. Bodyformat = 0
. Mailformat = 0
. Send
End
Set objcdomail = nothing
If err then
Sendmail = false
Err. Clear
Else
Sendmail = true
End if
End Function

If request. Form <> "" then
Mailto = trim (request. Form ("mailto "))
Mailform = trim (request. Form ("email "))
Title = trim (request. Form ("title "))
Content = ""
For each mailkey in request. Form
Content = content & "<br>" & mailkey & ":" & trim (request. Form (mailkey ))
Next
Elseif request. querystring <> "" then
Mailto = trim (request. querystring ("mailto "))
Mailform = trim (request. querystring ("email "))
Title = trim (request. querystring ("title "))
Content = ""
For each mailkey in request. querystring
Content = content & "<br>" & mailkey & ":" & trim (request. querystring (mailkey ))
Next
Else
Response. Write ("<script language = JavaScript> alert ('send email in the correct way '); window. Close (); </SCRIPT> ")
Response. End
End if
'Response. Write (content)
'Response. End ()
Pdsendmail = Sendmail (mailto, mailform, title, content)
If not pdsendmail then
Response. Write ("<script language = JavaScript> alert ('sending failed'); window. Close (); </SCRIPT> ")
Else
Response. Write ("<script language = JavaScript> alert ('sent successfully'); window. Close (); </SCRIPT> ")
End if
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.