?
Solved

How send email web page asp

Posted on 2003-03-02
10
Medium Priority
?
242 Views
Last Modified: 2010-04-06
How send email web page asp
0
Comment
Question by:toeban
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 2

Expert Comment

by:Splat
ID: 8054028
I'm assuming that you are trying to send a HTML email uisng ASP...?

If so, this should work...

<%
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
    objCDO.MailFormat = 0  'tells it to be HTML
    objCDO.BodyFormat = 0  'tells it to be HTML
    objCDO.From = "your.address@domain.com"
    objCDO.value("Reply-To") = "your.address@domain.com"  'reply address
    objCDO.To = "address@domain.com"
    objCDO.CC = "address@domain.com"
    objCDO.BCC = "address@domain.com"
    objCDO.Subject = "This is a HTML email"
    objCDO.Body = "This is the body"
    objCDO.Send
Set objCDO = Nothing  'cleanup
%>

You can remove the Reply-To, CC, and BCC lines if you like.

0
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 8068447
I tried using the above code, but to no joy!  Is there anything other than ASP, that needs to be supported on the server?

  i.e  'Server.CreateObject("CDONTS.NewMail")'

0
 
LVL 4

Assisted Solution

by:whammy
whammy earned 80 total points
ID: 8068490
0
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 
LVL 2

Accepted Solution

by:
Splat earned 80 total points
ID: 8068527
The M$ CDONTS component does need to be installed on the server.  I'm not the admin for the servers that I use, so I'm not too sure how to install this component, but you can find out more information regarding CDONTS at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_denali_installing_cdo_for_nts.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_denali_cdo_for_nts_library.asp

0
 
LVL 6

Assisted Solution

by:BubbaisBest
BubbaisBest earned 80 total points
ID: 8089254
If your server has ASPMail installed here is the code for it.  I actually read from a form to send this HTML email message.  You can edit it as needed:

  Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
   
  strFirstName = Request.Form("first_name")
  strLastName = Request.Form("last_name")
  strSenderName = strFirstName & " " & strLastName
  strAddress = Request.Form("address")
  strCityState = Request.Form("city_state_zip")
  strEmailAddress = Request.Form("email")
  strProblemType = Request.Form("problem")
  strComment = Request.Form("comments")

  HTML = HTML & "<html>"
  HTML = HTML & "<head>"
  HTML = HTML & "<title>Your Page Title Here</title>"
  HTML = HTML & "</head>"
  HTML = HTML & "<body>"
  HTML = HTML & "From: " & strSenderName & "<br />"
  HTML = HTML & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " & strAddress & "<br />"
  HTML = HTML & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " & strCityState & "<br />"    
  HTML = HTML & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " & strProblemType & "<br />"    
  HTML = HTML & "<br /><br /><br />" & strComment
  HTML = HTML & "</body>"
  HTML = HTML & "</html>"
 
  Mailer.FromName = strSenderName
  Mailer.FromAddress = strEmailAddress
  Mailer.RemoteHost = "mail.mymailserver.com" ' change to your smtp mail server
  Mailer.AddRecipient "Where to send email name", "email address"
  Mailer.Subject = "Your Subject Here"
  Mailer.ContentType = "text/html"
  Mailer.BodyText = HTML

Shayne
0
 

Expert Comment

by:Ice69devil
ID: 8089935
hi toeban,
SPLAT's method using the CDONTS.NewMail object should work...i have created another similar one in another thread perhaps u can try as well....
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20541877.html

Cheers

IcE
0
 

Expert Comment

by:sreekanth_k77
ID: 8108807
<% dim fromadd,toadd,sub,body,cls
fromadd=Request.Form("text1")
toadd=Request.Form("text2")
sub=Request.Form("text3")
body=Request.Form("TEXTAREA1")
set cls=Server.CreateObject("cdonts.newmail")
cls.From=fromadd
cls.To=toadd
cls.Subject=sub
cls.Body=body
cls.Send
Response.Write "Your mail is send to " & t%>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9115212
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
LVL 6

Expert Comment

by:Programming_Gal
ID: 9647683
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between Splat, whammy, BubbaisBest

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Programming_Gal
EE Cleanup Volunteer
0
 
LVL 4

Expert Comment

by:whammy
ID: 9647757
Sounds good to me, they all have pretty much the same answers, and the 4guysfromrolla.com link that I gave has additional info as well on many other email components besides CDONTS.

I figured if Splat's solution didn't work, then at least one of the components in the link I posted should be installed on ANY ASP server. Apparently that's the same angle Bubba was taking with his ASPMail post, so his response is definitely valid.

You must really know your stuff, Programming_Gal, to come up with that solution for splitting points!
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question