Web Analytics Made Easy -
StatCounter having a link in an email - CodingForum

Announcement

Collapse
No announcement yet.

having a link in an email

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • having a link in an email

    I have this code in my page......however, when the user receives an email....they actually see the <a href="www(what my $referer is)........ and its not even a clickable link.......what can i do to actually make it a link?


    PHP Code:
    $mailcontent "$from went to and found and interesting thing that he would like for you to check out. Here is the link: <a href=\"$referer\">$referer</a> \nadditional comments by $from$comments"
    Last edited by grudz; Feb 13, 2004, 12:53 PM.

  • #2
    If you're gonna use html, then you need to use a html header for the email

    Content-Type: text/html; charset=iso-8859-15

    Look at http://www.php.net/mail for more details.

    Comment


    • #3
      i have that

      PHP Code:

      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> 
      <style type="text/css"> 
      <!-- 
      @import url("css/baselineNoBack.css"); 
      --> 
      </style> 
      <?php 
        $from 
      trim($_POST['from']); 
        
      $fromemail 'From: '.trim($_POST['fromemail']); 
        
      $to trim($_POST['to']); 
        
      $toemail trim($_POST['toemail']); 
        
      $subject trim($_POST['subject']); 
        
      $comments trim($_POST['comments']); 
        
      $referer trim($_POST['referer']); 

        
      $mailcontent "$from went to [url]www.mtl-baseline.com[/url] and found and interesting thing that he would like for you to check out. Here is the link: <a href=\"$referer\">$referer</a> \nadditional comments by $from$comments"


        
      mail($toemail$subject$mailcontent$fromemail);

      Comment


      • #4
        It needs to be in the email header, not html header

        PHP Code:
        <?php 

          $from 
        trim($_POST['from']); 

          
        $fromemail 'From: '.trim($_POST['fromemail']); 

          
        $fromemail .= 'Content-Type: text/html; charset=iso-8859-15';

          
        $to trim($_POST['to']); 

          
        $toemail trim($_POST['toemail']); 

          
        $subject trim($_POST['subject']); 

          
        $comments trim($_POST['comments']); 

          
        $referer trim($_POST['referer']); 



          
        $mailcontent "$from went to <a href="http://www.mtl-baseline.com" target="_blank">[url]www.mtl-baseline.com[/url]</a> and found and interesting thing that he would like for you to check out. Here is the link: <a href=\"$referer\">$referer</a> \nadditional comments by $from: $comments"; 





          
        mail($toemail$subject$mailcontent$fromemail);

        Comment


        • #5
          i can do this......

          PHP Code:

          $mailcontent 
          "$from went to [url]www.mtl-baseline.com[/url] and found and interesting thing that he would like for you to check out. Here is the link: $referer \nadditional comments by $from$comments"
          but if the $referer is site.com/my name
          its going to stop after "my" not going until "name"

          Comment


          • #6
            Then you need to use rawurlencode() to chance spaces to %20

            Comment


            • #7
              i know about that...actually urldecode works.....not rawurlencode

              Comment


              • #8
                the code u gave me works great thanx....however, u made my variable $fromemail = 'content......'

                but i had a textbox called fromemail that i needed......u took out the $_POST and put 'Content-Type: text/html; charset=iso-8859-15';.......how do i have to configure it now?

                Comment


                • #9
                  im sorry, i didnt see ur last post correctly.......thank you for your help

                  Comment

                  Working...
                  X