Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - HTML Emails
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HTML Emails

 Post Reply Post Reply Page  123>
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Topic: HTML Emails
    Posted: 21 April 2004 at 6:24pm
I would like to send html emails to people from a form on a web page. I would like to be able to tell when someone reads the email. I would like for the email to redirect to a web page like http://www.anywhere.com/reademail.asp?ID=4. But I don't want the email to actually take the person to the web page. Can someone please give me a few lines of code on how to do this?
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2004 at 8:08pm

http://www.aspfaq.com/show.asp?id=2474

Bear in mind that the trend in email clients is to have html display turned off by default.



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
thekiwi View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 23 November 2003
Location: New Zealand
Status: Offline
Points: 392
Post Options Post Options   Thanks (0) Thanks(0)   Quote thekiwi Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2004 at 5:04pm
Originally posted by dpyers dpyers wrote:

http://www.aspfaq.com/show.asp?id=2474

Bear in mind that the trend in email clients is to have html display turned off by default.


Which isnt a problem if you send both headers, ie PlainText and HTML
eg

            Set objMailer = Server.CreateObject("CDOnts.NewMail")
            objMailer.BodyFormat = CdoBodyFormatHTML
            objMailer.MailFormat = CdoMailFormatText

Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2004 at 3:05pm

thekiwi,

Do you know if I will still be able to track when someone reads my email if they open the email in Plain Text?

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2004 at 5:44pm

With either an HTML or a text email, you can have an active link to take a user to a page.

With HTML, you can include an image in the email that is loaded from your site. You can set up the image src for something like http://www.mysite.com/image.jpg?ID&NUM=9999 - where 9999 is some code that you put on that specific email.

You then write yourself a little script to view your logs and pull the 999's and match them up against your data base to find out who opened the email. - Note that instead of 9999, you could have something like IDNUM=Username

I use Outlook 2003 which has images turned off by default so this wouldn't work for me or for similar email clients.

You can also send either a text or an html email with a "Request Receipt" option. But most email clients will not send you a receiept by default.

Bottom line is that there's no sure way to tell if someone reads your email.



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2004 at 9:46pm

I have created the web pages. However, I have one problem. I get notified by email that the person has read the email after I have sent it which is not true. How do I fix this problem?

Here are some significiant lines of code to look at:

MHTMLBody = "http://www.--------.com/ReadEmail.asp?ID=" & EmailNum

Few lines of code for ReadEmail.asp:

If Read = false then rs("TimeRead") = Now()
'Set value of boolean field
rs("Read") = true rs.Update

 

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2004 at 1:27am

Originally posted by Misty Misty wrote:

I have created the web pages. However, I have one problem. I get notified by email that the person has read the email after I have sent it which is not true.

Do you get notified for all emails you send, or just some of them?

You'll have to print more code. what you show may mean something to someone else, but it puzzles me.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2004 at 1:43am

I get notified for all of the emails that I send out. I will give you the code for both web pages (1. The web page that sends the email out. 2.) The ASP page that adds yes to the read box in the database when someone has read a particular email.

The page that sends the email:

<%

'EmailSent.asp

%>

<%

    'declare variables

    'Strings for recipient, subject, boby

    Dim SubjectLine, Body, EmailNum

    Dim MyMail 'The Jmail object

    Dim rs

 

    'grab the variables from the form

    EmailNum = Request.QueryString("EmailID")

  

   

    'Declare constants for a recordset that allows adding records

     

   

      dim sqlString

      dim connectionString, databaseName, path

      dim SEmail, Sender, EmailBody, Email

      dim Name, Msg, EmailAddr

     

     

      

      'Set connection details

     

  

      sqlString = "Select * FROM Emails, Users"

      'Add WHERE Join clause

      sqlString = sqlString & " where Emails.EmailID=Users.EmailID"

      sqlString = sqlString & " and Emails.EmailID=" & EmailNum

      set rs = Server.CreateObject("ADODB.Recordset")

      rs.Open sqlString, connectionString

    

  

    'loop through the recordset

    While Not rs.EOF

    SEmail = rs("SEmail")

    Sender = rs("Sender")

    Name = rs("Name")

Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.