Web hosting shared dedicated hosting for free web hosting connected to our high-speed Internet backbone.

|
Sending Email from Within a Web Page
It is very easy to send email from within a web page. The two most common uses of this capability are to send the results of a customized form in an email message
or to create hidden messages that are sent to you when somebody visits one of your pages. To embed email commands, you must first be at least vaguely familiar with
Microsoft Active Server Pages (ASPs). You may want to read this short ASP overview before continuing.
The code should be in an ASP page (e.g. sendmail.asp), and should be called from a forms page (e.g. mailform.html) such as the following:
e.g. mailform.html:
<FORM METHOD="POST" ACTION="sendmail.asp">
Your email address: <INPUT TYPE=TEXT NAME="EmailField"><BR>
Information 2: <INPUT TYPE=TEXT NAME="info2"><BR>
Information 3: <INPUT TYPE=TEXT NAME="info3"><BR>
Type your message: <INPUT TYPE=TEXT NAME="messageBody"><BR>
<INPUT TYPE=SUBMIT>
</FORM>
e.g. sendmail.asp:
<%
for each key in request.form
eBody = eBody & key &": " &request.form(key) &chr(10)
next
SET JMail = Server.CreateObject("JMail.smtpmail")
JMail.ServerAddress = "formmail.strongsecure.com"
JMail.Sender = request.form("EmailField")
JMail.Subject = "Hello!"
JMail.AddRecipient "user@yourdomain.com"
JMail.Body = eBody
JMail.Execute
SET JMail = Nothing
%>
Your message has been sent.
Very Important:
Note that there is no equal sign "=" after the AddRecipient command.
Options:
You can optionally add the following line to send HTML-encoded mail:
JMail.ContentType="text/html"
Full Jmail documentation (all features may not be supported), is located
in the Jmail Reference Manual
|
|
©2008 HostingLogin.com All rights reserved.
Terms of Service . Acceptable Use . Privacy Policy
|