SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using URL in email body text

    On my product detail page I have a small form that allows the visitor to enter their details, submit on a particular item and in turn they get an email and my client does informing him of this information request.

    I used the code below to grab the url:

    PHP Code:
    $actual_link "http://$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]?stock_ID=$sid"
    Which works fine. But my problem arises when i try and use it in an email to be sent to both the visitor and the client.

    This is the code:

    PHP Code:
    $to $likeEmail;
     
    $subject "Thank you for your enquiry at Sovereign Antiques";
     
    $body "Thank you for your interest in the item below: \n\n<a href='$actual_link'>$actual_link</a>\n\nYour interest has been recieved by email and we will call you back very soon.\n\nAgain thank you for visiting Sovereign Antiques, and we look forward to speaking with you soon.\n\nKind Regards\n\n Jason Sallam"
    As you can see, $actual_link is in the body text, but its not outputting corectly.

    This is what I see in the email:

    http://www.accendsandbox.co.uk./detail.php?stock_ID=5'>http://www.accendsandbox.co.uk./detail.php?stock_ID=5>

    Which is using the correct details, but it isnt formatting correctly as you will see when I looked at the sourse code for that email.

    Code:
    <a href='<a target="_blank" href="parse.php?redirect=http%3A%2F%2Fwww.accendsandbox.co.uk.%2Fdetail.php%3Fstock_ID%3D5%27%3Ehttp%3A%2F%2Fwww.accendsandbox.co.uk.%2Fdetail.php%3Fstock_ID%3D5%3C%2Fa"><font color='red'>http://www.accendsandbox.co.uk./detail.php?stock_ID=5'>http://www.accendsandbox.co.uk./detail.php?stock_ID=5</a</font></a>><br>
    Its just not right.

    Can anybody see the problem, as I'm a bit stumped now.

  2. #2
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:


    PHP Code:
    $subject "Thank you for your enquiry at Sovereign Antiques";
     
    $body "Thank you for your interest in the item below: \n\n$actual_link\n\nYour interest has been recieved by email and we will call you back very soon.\n\nAgain thank you for visiting Sovereign Antiques, and we look forward to speaking with you soon.\n\nKind Regards\n\n Jason Sallam"

  3. #3
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    TUT, yes that did work, so there no need for any html formatting, I spent a long time trying to format it correctly, when it didnt need any.

    Thank you very much, much appreciated.

  4. #4
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pleasures !


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
  •