PC Review


Reply
Thread Tools Rate Thread

Cdont's script

 
 
Shona
Guest
Posts: n/a
 
      27th Jan 2004
Hi

I have the following script on my confirmation page. It all works fine and
when I receive a mail it says it From what ever has been typed in the field
Name. However what I would also like it to put is the persons surname as
well with a space in between.


<%
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.To = "(E-Mail Removed)"
objCDOMail.From = FP_SavedFields("Name")
objCDOMail.Subject = FP_SavedFields("Results")
strBody = strBody & "Name: " & FP_SavedFields("Name") & VbCrLf
strBody = strBody & "Surname: " & FP_SavedFields("Surname") & VbCrLf
objCDOMail.Body = strBody
objCDOMail.BodyFormat = 1
objCDOMail.MailFormat = 1
objCDOMail.Send
Set objCDOMail = Nothing
%>

Hope someone has the answer for me.

Cheers Shona


 
Reply With Quote
 
 
 
 
Jon Spivey
Guest
Posts: n/a
 
      27th Jan 2004
Hi Shona,

The syntax would be
objCDOMail.From = "Jon Spivey <(E-Mail Removed)>"
so you'd probably have something like
objCDOMail.From = FP_SavedFields("Name") & " " & FP_SavedFields("LastName")
& " <" & FP_SavedFields("LastName") & ">"

Although you might want to move away from CDONTS as it's no longer
supported, so when you upgrade to xp pro and/or your host upgrades to
windows server 2003 your code will no longer run. So you might want to take
this oppurtunity to migrate your code over to cdo, see this article
http://www.aspfaq.com/show.asp?id=2026

--
Cheers,
Jon
Microsoft MVP - FP


"Shona" <(E-Mail Removed)> wrote in message
news:bv609b$f3k$(E-Mail Removed)...
> Hi
>
> I have the following script on my confirmation page. It all works fine

and
> when I receive a mail it says it From what ever has been typed in the

field
> Name. However what I would also like it to put is the persons surname as
> well with a space in between.
>
>
> <%
> Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
> objCDOMail.To = "(E-Mail Removed)"
> objCDOMail.From = FP_SavedFields("Name")
> objCDOMail.Subject = FP_SavedFields("Results")
> strBody = strBody & "Name: " & FP_SavedFields("Name") & VbCrLf
> strBody = strBody & "Surname: " & FP_SavedFields("Surname") & VbCrLf
> objCDOMail.Body = strBody
> objCDOMail.BodyFormat = 1
> objCDOMail.MailFormat = 1
> objCDOMail.Send
> Set objCDOMail = Nothing
> %>
>
> Hope someone has the answer for me.
>
> Cheers Shona
>
>



 
Reply With Quote
 
Shona
Guest
Posts: n/a
 
      27th Jan 2004
Thanks for that modified it slightly and it works

objCDOMail.From = FP_SavedFields("Name") & " " & FP_SavedFields("Surname") &
" <" & FP_SavedFields("Name") & FP_SavedFields("Surname") & ">"

Will certainly look at the cdo if I'm going to run into problems later on.

Thanks again

Shona

"Shona" <(E-Mail Removed)> wrote in message
news:bv609b$f3k$(E-Mail Removed)...



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How would you write a script to add and apply a group policy in Active Directory? Script could be VBscript arpitaashokadessai@gmail.com Microsoft Windows 2000 Active Directory 1 14th Feb 2007 09:07 PM
Is this CDO as opposed to CDONT SS Microsoft Frontpage 3 26th Jun 2006 11:47 PM
cdo or cdont SS Microsoft Frontpage 2 23rd Jun 2006 04:03 PM
BUG: Script blocking strips script parameters during script authorization Jonathan K. Shay Spyware Announcements 3 2nd May 2005 06:18 PM
NDR error using CDONT in VB app Bill Nguyen Microsoft Windows 2000 DNS 1 6th Jan 2004 12:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:18 PM.