SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Mar 2006
    Posts
    701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    phpmailer and getfile()

    I want to send an email with phpmailer and to have as body a template file with some text dynamically.
    I wrote some variables ($some...) at template.php and I gave values at the sendmail.php but it did not work.
    Can I do it and how?
    Dimis

  2. #2
    SitePoint Zealot
    Join Date
    May 2006
    Location
    Jhyalipati,Chapagaun-9, Lalitpur, Bagmati, Nepal
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This link may help you.
    http://www.php.net/eval
    Simply Sajan

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use a placeholder like

    Code:
    Hello %name%, today is %date%.
    PHP Code:
    $find_replace = array(
        
    '%name%' => $name
      
    '%date%' => $date
    );

    echo 
    str_replace(array_keys($find_replace), array_values($find_replace), $text); 


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
  •