3w study

submit to 3000 search engines
You are reading :: English:: Learning ASP SQL VB HTML code

Learning .ASP SQL HTML XML CSS JAVA Perl code study
English Chinese_Traditional Chinese_Simplified

You are reading :: English English

Learning.Topic:
HOME
XML
VBscript
SQLserver
SQL
SearchEngine
Robots
php
Microsoft
JAVA
InternetProtocol
HTML
Ecommerce
CSS
ASP
. Active-Server-Flash
. Array
. Cache
. Connection
. Count
. Counter
. Distinct
. Email
»CDO.Message
»CDO.Message.error
»JMail.SMTPMail
»Persits.MailSender
»SMTPsvg.Mailer
. File
. Folder
. Function
. GetSQLserver
. Header
. mySQL
. Record
. Recordset
. Request
. Response
. Server
. server-createobject
. ServerVariables
. Session
. Special-Symbols
. String
. Sub
. Time

SiteMap

3w....Learning.tutorials > ASP > email » jmail.smtpmail

3w learning

email >
jmail.smtpmail

Title:

Set JMail = Server.CreateObject("JMail.SMTPMail") use JMail.SMTPMail to send email ----- you may set a different name as you wish --- set SMTP=Server.CreateObject("Jmail.SMTPMail")


Description:

First:: To confirm your web server does have JMail service installed before you run JMail.SMTPMail create and send a email by using Jmail.SMTPMail It often been used to create autoresponse email example: member information , forgot password email sending. you may send text or html form Plain Text format [ linebreaks to the mailbody Use vbcrlf ] example: JMail.AppendText "Dear," & vbCrLf HTML format must have ContentType [ JMail.ContentType = "text/html" ] ------------- attention -------------- Sender email address and AddRecipient (receiver) email address are required to be listed by Jmail Every email has its unity ID even if you used false info, your location still will be listed at many servers. [ no way to hide ] -------attention :: internet security ----------- set your email browser to read only text format is always safer than to read HTML format even if preview a HTML format


Example Code:

<% Email=request("send-to-where-email") Set JMail = Server.CreateObject("JMail.SMTPMail") JMail.ServerAddress = "your-server-name" Jmail.ContentTransferEncoding = "base64" Jmail.ISOEncodeHeaders = false JMail.ContentType = "text/html" JMail.Encoding = "base64" JMail.MimeVersion = "1.0" JMail.sender = "your@email" JMail.SenderName= "sender name" JMail.Subject = "mail subject" JMail.AddRecipient Email JMail.ReplyTo="email@--1--.com" JMail.ReplyTo="email@--2--.com JMail.Body ="<meta http-equiv=Content-Type content=text/html; charset=utf-8>" JMail.Body =JMail.Body& "Hi, this is an ASP Jmail example HTML mail<br>" JMail.Body =JMail.Body&"<a href= ""http://-------/asp/email""> http://-------/asp/email</a> <br> " JMail.Priority=3 JMail.Execute set JMail=nothing %> --------------------------------------- your-server-name :: can be a domain name or an IP it depends on your server setting if you rent a hosting then you shall ask your ISP support --- Example 2 --- <% '---- login SMTP pw to send email --- dim username, email, tel, memo username=Trim(request("username")) email=Trim(request("email")) tel=Trim(request("tel")) memo=Trim(request("memo")) Set JMail = Server.CreateObject("Jmail.Message") JMail.silent=true JMail.Logging = true JMail.Charset = "utf-8" JMail.ContentType = "text/html" JMail.MailServerUserName = "SMTP-account@---.com"'SMTP account JMail.MailServerPassword = "Pass word" 'SMTP pw JMail.From = "sender-email@---.com" JMail.FromName = "sender name" JMail.AddRecipient email ' receiver email JMail.Subject = "a test mail" Body= "receiver:" & username & "<br>Tel:" & tel & now Body=Body&"<br>email:" & email & "<br>memo:" & memo Body=Body&"<br><font size=5>Best Regards,<br>Ezer</font>" JMail.Body = Body JMail.Send ("mail.----.com")'set SMTP Server set JMail = nothing response.write "mail sent" & chr(13) & "ok" Response.End %> Example3 -------Ezer.com----- yes you may use vbCrLf to replace "<br>" chr(13) to replace "<br>" -----Ezer----- tips -------- chr(10) a 'line feed' ; returns a linefeed character chr(13) a 'carriage return' ; returns a carriage return character they are different -----------larger font for text/html form-------- "<font size=""5"">Best Regards,<br>Ezer</font>" or "<font size=5>Best Regards,<br>Ezer</font>" or "<h1>Best Regards,<br>Ezer</h1>" -----------add an image for text/html form ----------- "<a href=""http://__""><img src=""http://__.gif"" border=""0""></a>" or "<a href=http://___><img src=http://___.gif border=0></a>"


Example Result:

Sender : your@email
receiver: Email@email
subject : mail subject

Hi, this is an ASP Jmail example HTML mail
http://3w.ezer.com/asp/email



-------------------------------------- this jmail example can send html code by using: [ JMail.ContentType = "text/html" ] -------- character conversion -------- [ JMail.ISOEncodeHeaders = false ] [ Jmail.ContentTransferEncoding = "base64" ] or [ JMail.ContentTransferEncoding = "8bit" ]


..
...
...

[ 7/3/2009 ]

Web Tools
Table Builder
Meta Builder
Mask Maker

www learning school add more scripts and tips memo
You are at >>3W.EZER.COM >> 3W.EZER.COM/ASP/EMAIL/JMAIL.SMTPMAIL.ASP>>ASP
Helpful link:: SEO web tools :: Live PR | SERP checker Google SERP pageranking checker
back to top Ezer code adding :: Questions ;email PageRank.seoserp.com PR bar