Jmail email example in asp

Submitted on: 1/6/2015 7:25:00 AM
By: pompyk (from psc cd)  
Level: Beginner
User Rating: By 4 Users
Compatibility: ASP (Active Server Pages)
Views: 1764
     The sole purpose of this article is to help those who could not figure out the right purpose of jmail object in asp....Just a simple example to send emails using jmail object...



' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )

' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true

' Most mailservers require a valid email address
' for the sender

'This email address I guess must be that which is provided when u booked 'your domain....

msg.From = ""

' Next we have to add some recipients.
' The addRecipients method can be used multiple times.
' Also note how we skip the name the second time, it
' is as you see optional to provide a name.

msg.AddRecipient "", "SOMDUTT"
'msg.AddRecipient ""

' The subject of the message
msg.Subject = "WHATEVER U LIKE"
'don't use the same..u must make a html form...using it..
'so that u can submit it...
' Note the use of vbCrLf to add linebreaks to our email

msg.Body ="Name: " & request.form("name") & vbcrlf & _
"Address: " & request.form("address") & vbcrlf & _
"City: " & request.form("city") & vbcrlf & _
"Zip: " & request.form("zip") & vbcrlf & _
"Phone: " & request.form("phone") & vbcrlf & _
"Email: " & request.form("email") & vbcrlf & _
"Fax: " & request.form("fax") & vbcrlf & _
"Car: " & request.form("listcar") & vbcrlf & _
"Bus: " & request.form("listbus") & vbcrlf & _
"Utilisation Start Date: " & request.form("txtDate") & vbcrlf & _
"Utilisation End Date: " & request.form("txtDate2") & vbcrlf & _
"Payment Preference: " & request.form("select") & vbcrlf & _
"Places to be visited: " & request.form("place")
' To send the message, you use the Send()
' method, which takes one parameter that
' should be your mailservers address
' To capture any errors which might occur,
' we wrap the call in an IF statement
'if not msg.Send("" ) then

if not msg.Send("" ) then
Response.write "
" & msg.log & "
Response.write "Message sent succesfully!"
end if
' bye bye...go u have done it!!..thx..


This is just a little help to those who got entangled in JMAIL

Other 1 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.