Article View: comp.lang.javascript
Article #17Re: Sending a CDONTS email
From: Ben
Date: Wed, 24 Jul 2002 17:58
Date: Wed, 24 Jul 2002 17:58
71 lines
3109 bytes
3109 bytes
Sorry it doesn't have to be CDONTS, I just need the cookie to send an
email!!
--
I'm a socialist saving up to become a capitalist.
http://fly.to/bendyer
"Ben" <ben@iow-office.fsnet.co.uk> wrote in message
news:ahmnhu$cg$1@news5.svr.pol.co.uk...
> Hi Guys,
>
> Can anyone help! I am trying to put together a basic cookie in JavaScript.
> The cookie part of the script it working perfectly, no problems there.
> However after the cookie has been executed I want the script to send an
> email using CDONTS. This is where I am having problems.
>
> I only want the email to be sent if the cookie is executed ie if it
exists.
> Currently nothing is working, if I take out the email side of the script
the
> cookie works, but I need both running.
>
> Any ideas where I am going wrong?
>
> <script>
> <!--
>
>
> // page to go to if cookie exists
> go_to = "software.htm";
>
> // number of days cookie lives for
> num_days = 1;
> function ged(noDays){
> var today = new Date();
> var expr = new Date(today.getTime() + noDays*24*60*60*1000);
> return expr.toGMTString();
> }
>
> function readCookie(cookieName){
> var start = document.cookie.indexOf(cookieName);
> if (start == -1){
> document.cookie = "seenit=yes; expires=" + ged(num_days);
> } else {
> window.location = go_to;
> }
> }
>
> readCookie("seenit");
>
> // now send the email using CDONTS
>
> Set sendmail = Server.CreateObject("CDONTS.NewMail")
> sendmailMsg.From = email@email.com
> sendmailMsg.To = user@user.com
> sendmailMsg.subject = "Subject"
> sendmailMsg.body = "Body"
> sendmailMsg.send
>
> // -->
> </script>
>
>
> Hope you can help!
>
> Cheers
>
> Ben
>
>
Technical Details
Message-ID:
<ahmppv$3ld$1@news6.svr.pol.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!demon!newshub1.nl.home.com!news.nl.home.com!news.telebyte.nl!news.nl.linux.org!humbolt.nl.linux.org!zen.net.uk!newspeer.lavaseals.co.uk!diablo.theplanet.net!news.theplanet.net!not-for-mailReferences:
<ahmnhu$cg$1@news5.svr.pol.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100e17,c1c4460db7d5ea6e X-Google-Attributes: gid100e17,public X-Google-Thread: fb3cb,c1c4460db7d5ea6e X-Google-Attributes: gidfb3cb,public X-Google-ArrivalTime: 2002-07-24 11:00:18 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!demon!newshub1.nl.home.com!news.nl.home.com!news.telebyte.nl!news.nl.linux.org!humbolt.nl.linux.org!zen.net.uk!newspeer.lavaseals.co.uk!diablo.theplanet.net!news.theplanet.net!not-for-mail From: "Ben" <ben@iow-office.fsnet.co.uk> Newsgroups: comp.lang.javascript,alive.internet.lang.javascript Subject: Re: Sending a CDONTS email Date: Wed, 24 Jul 2002 18:58:37 +0100 Organization: Working from Home Lines: 73 Message-ID: <ahmppv$3ld$1@news6.svr.pol.co.uk> References: <ahmnhu$cg$1@news5.svr.pol.co.uk> Reply-To: "Ben" <ben@iow-office.fsnet.co.uk> NNTP-Posting-Host: modem-20.anduin.dialup.pol.co.uk X-Trace: news6.svr.pol.co.uk 1027533439 3757 62.136.108.148 (24 Jul 2002 17:57:19 GMT) NNTP-Posting-Date: 24 Jul 2002 17:57:19 GMT X-Complaints-To: abuse@theplanet.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000