-1

プレーンテキストでメールを送信するスクリプトがあり、テーブル付きのメールテンプレートを追加したいのですが、そのスクリプトはメッセージに次のコードを使用しています。

       $body= nl2br('Dear Family and Friends,'.$space."\n\n".' This message is from
 '.$info[0]->first_name.' '.$info[0]->last_name.' who is challenging you to join him 
        at Grow for the Cure to raise money for lung cancer research. '.$space."\n\n".'Have
         you ever wondered what it would be like to see your buddy sport a slick mustache or
         rock some big ol pork chop sideburns? Your friend has courageously provided his face 
        as a blank canvas and put YOU in charge.'.$space."\n".'Grow for the Cure and the Bonnie
     J. Addario Lung Cancer Foundation invite you to click on the link below to see how your
         friend has volunteered to raise money for lung cancer research. Check out his personal
     page where you will be able to see which look is in the lead, and make a donation to your
     favorite choice!'.$space."\n\n".'Your friend needs your support and the research community
     definitely needs your help. Lung cancer kills more people than breast, prostate, colon, 
    liver, kidney, and melanoma cancers combined. Yet, it receives a fraction of 
        the attention and funding. With your help, we are going to change that focus and make
     an impact.'.$space."\n"."All donations go to the Bonnie J. Addario Lung Cancer 
        Foundation and will be used on the front lines of lung cancer research. 
        Your donation WILL make a difference.<p style='color:blue;font-weight:bold;'>"
.$data['glink'].'</p>'.$space."\nHere's what your friend has to say:\n\n".'
     '.$comments."\n\n"."Please visit xyz.org today!\n\nGw  is an affiliate of the\n"."Bonnie\n\n");

これにHTMLコードを実装するにはどうすればよいですか?私にお知らせください。ありがとう

4

1 に答える 1

0

あなたが何を求めているのかを正しく理解していれば、これを行うことができます:

$body= nl2br('Dear <b>Family</b> and <p style="color:red;">Friends</p>
,'.$space."\n\n".'This message is from '.$info[0]->first_name.' and 
more text here');

次のような埋め込まれた二重引用符または単一引用符は必ずバックスラッシュで囲んでください。

echo "He said \"That's lame!\" or something.";
echo 'He said "That\'s lame!" or something.';
于 2012-05-05T01:20:42.053 に答える