Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2006, 04:56 PM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default e-mail a webpage

Hi! Everyone

I used vbsendmail as a component to send e-mail and it works fine.
I try to use send a whole webpage thru emai using ASP.
I need your help any idea to do it.

Thanks,
Elmer

Reply With Quote
  #2 (permalink)  
Old July 7th, 2006, 11:23 PM
Authorized User
 
Join Date: Apr 2006
Location: Edmonton, , Canada.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This command goes at the top of your page:
Code:

Here is the function you use for sending the mail:
Code:
<%'VBScript function to send email using CDOSYS
' Usage: sendEmail "to@somewhere.com", "from@somewhere.com", "Subject", "Body"
Function sendEmail(address_to, address_from, subject, body)
     'the mail object
     Dim ObjMail
     Set ObjMail = CreateObject("CDO.Message")
     'mail configuration
     Dim objConfig
     Set objConfig = CreateObject("CDO.Configuration")
 
     'replace any line breaks in the mail body with <br> tag for HTML email
     emailBody = Replace(body, chr(10), "<br>")
 
     'set up the mail server, port etc.
     With objConfig
          .Fields(cdoSendUsingMethod) = cdoSendUsingPort
          'Try Local Machine
          .Fields(cdoSMTPServer) = "someservernamehere" 'change the server name, of course
          .Fields(cdoSMTPServerPort) = 25
          .Fields(cdoSMTPAuthenticate) = cdoBasic
          .Fields.Update
     End With
 
     'the message
     With objMail
          .Configuration = objConfig
          .From = address_from
          .To = address_to
          .Subject = subject
          .HTMLBody = emailBody 'for sending HTML email
                                '.TextBody = emailBody  'for sending Text only email
          .Send
     End With
 
     Set objMail = Nothing
     Set objConfig = Nothing
 
End Function
%>
Then just call this function like so:

sendEmail EmailToSendTo, EmailToSendFrom, Subject, BodyOfTheEmail



Reply With Quote
  #3 (permalink)  
Old July 10th, 2006, 04:20 PM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default

cstooch,

Thanks for your reply. CDOSYS
is a free components to send an email. if so where can I download it?

Elmer

Reply With Quote
  #4 (permalink)  
Old July 10th, 2006, 11:18 PM
Authorized User
 
Join Date: Apr 2006
Location: Edmonton, , Canada.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought CDOSYS was built in to ASP...

I had to include this line at the top of my pages for it to work though:



Reply With Quote
  #5 (permalink)  
Old July 11th, 2006, 11:26 AM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default

cstooch,

Wow thanks for your help it works..

Thanks,
Elmer

Reply With Quote
  #6 (permalink)  
Old July 11th, 2006, 08:05 PM
Authorized User
 
Join Date: Apr 2006
Location: Edmonton, , Canada.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Awesome, glad I could help!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
Sending e-mail to different mail box! Calibus Classic ASP Databases 4 September 3rd, 2004 05:48 PM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM



All times are GMT -4. The time now is 05:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.