SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Resident Boozehound simontheak's Avatar
    Join Date
    Jun 2003
    Location
    _root.europe.uk.london
    Posts
    965
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inserting links into e-mails

    I am trying to insert a hypertext link in to a dynamically generated e-mail. It seems simple enough - but I can't quite get it to work.

    I can send an e-mail if I use:
    PHP Code:
    <a href='www.mydomain.com'
    but when I click on it, I get a message from hotmail (which I'm using to check the mail) saying that it can't find their pages on the local server. So I figured that I should insert an http:// at the begginning of the URL to force hotmail to look outside of its local servers.

    However, when I use the following code:
    PHP Code:
    <a href='http://www.mydomain.com'
    I get an e-mail through, but there's no content in it all!

    Here's the whole section of the script:

    PHP Code:
    $headers  "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: Woolmeister's Kitchen <info@woolmeisterskitchen.com>";

    mail($eMail"Newsletter Subscription""<font face='Tahoma' size='2' color='#000000'>
    Thanks for your subscription to our Newsletter.
    <p>You will now receive regular updates regarding future events.<p>
    To unsubscribe <a href=www.mydomain.com/unsubscribe.php?eMail=
    $eMail>click here</a>",$headers); 
    Can anyone let me know what I'm doing wrong?

    Thanks alot

  2. #2
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried sending an email to my hotmail account with your script and it worked fine. So I'm not sure why you are getting a blank email.

    Did you try sending it to another email account?
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  3. #3
    Resident Boozehound simontheak's Avatar
    Join Date
    Jun 2003
    Location
    _root.europe.uk.london
    Posts
    965
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mmm - that's strange. Which version of the URL did you use? Did you put the http:// in front of it? And did the linked page actually load up?

  4. #4
    Resident Boozehound simontheak's Avatar
    Join Date
    Jun 2003
    Location
    _root.europe.uk.london
    Posts
    965
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do I need to escape the forward slashes in http://? Could that be why it's not working?

  5. #5
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by simontheak
    Mmm - that's strange. Which version of the URL did you use? Did you put the http:// in front of it? And did the linked page actually load up?
    Yes I did. I used <a href=\"http://www.mydomain.com/unsubscribe.php?eMail=$eMail\">.

    The page I put in the link load fine.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  6. #6
    Resident Boozehound simontheak's Avatar
    Join Date
    Jun 2003
    Location
    _root.europe.uk.london
    Posts
    965
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh - that's got it. Thanks very much for your help Toly


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •