<bdo id='5fO6R'></bdo><ul id='5fO6R'></ul>
  • <tfoot id='5fO6R'></tfoot>

    1. <small id='5fO6R'></small><noframes id='5fO6R'>

      <i id='5fO6R'><tr id='5fO6R'><dt id='5fO6R'><q id='5fO6R'><span id='5fO6R'><b id='5fO6R'><form id='5fO6R'><ins id='5fO6R'></ins><ul id='5fO6R'></ul><sub id='5fO6R'></sub></form><legend id='5fO6R'></legend><bdo id='5fO6R'><pre id='5fO6R'><center id='5fO6R'></center></pre></bdo></b><th id='5fO6R'></th></span></q></dt></tr></i><div id='5fO6R'><tfoot id='5fO6R'></tfoot><dl id='5fO6R'><fieldset id='5fO6R'></fieldset></dl></div>
      <legend id='5fO6R'><style id='5fO6R'><dir id='5fO6R'><q id='5fO6R'></q></dir></style></legend>
      1. 邮件内容在 Joomla 3 中显示为 html 代码

        Mail content shows as html code in Joomla 3(邮件内容在 Joomla 3 中显示为 html 代码)
      2. <legend id='yhK7u'><style id='yhK7u'><dir id='yhK7u'><q id='yhK7u'></q></dir></style></legend>
        • <bdo id='yhK7u'></bdo><ul id='yhK7u'></ul>
                <tbody id='yhK7u'></tbody>
              <i id='yhK7u'><tr id='yhK7u'><dt id='yhK7u'><q id='yhK7u'><span id='yhK7u'><b id='yhK7u'><form id='yhK7u'><ins id='yhK7u'></ins><ul id='yhK7u'></ul><sub id='yhK7u'></sub></form><legend id='yhK7u'></legend><bdo id='yhK7u'><pre id='yhK7u'><center id='yhK7u'></center></pre></bdo></b><th id='yhK7u'></th></span></q></dt></tr></i><div id='yhK7u'><tfoot id='yhK7u'></tfoot><dl id='yhK7u'><fieldset id='yhK7u'></fieldset></dl></div>

                <tfoot id='yhK7u'></tfoot>

                1. <small id='yhK7u'></small><noframes id='yhK7u'>

                  本文介绍了邮件内容在 Joomla 3 中显示为 html 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我编写了一个发送邮件的脚本,它被发送到正确的电子邮件地址,但以 HTML 代码的形式,我不知道为什么它不工作,因为相同的代码在 Joomla 2.5 中工作正常.

                  I have written a script for sending a mail, it gets delivered to the correct email address but in them form of HTML code, I don't know why it's not working as same code is working fine in Joomla 2.5.

                  这是我的代码:

                  $mailer = JFactory::getMailer();
                  $config = JFactory::getConfig();
                  $subject = 'Account Created';
                  $from   = $config->get('mailfrom');
                  $fromname = $config->get( 'fromname' ); 
                  
                  $body = "<p>Hello Test F,</p><br/><p>Thank you for registering at Deals&offers. Your account is created and activated.</p><br/>You may login to ".JURI::root().'index.php'." using the following username and password:</br><p>Username: ".$fname."</p><p>Password: ".$pwd."/p><br/><p><b>Note:</b> It is recomended to change your password after first login.</p>";
                  
                  $sender = array( 
                      $from,
                      $fromname
                  );
                  
                  $mailer->setSender($sender); 
                  
                  $mailer->addRecipient($buyerEmail);
                  
                  $mailer->setSubject($subject);
                  
                  $mailer->setBody($body);
                  
                  $send = $mailer->Send();
                  
                  if ( $send !== true ) {
                      echo 'Error sending email: ' . $send->message;
                  } else {
                      echo 'Mail sent';
                  }
                  

                  我也像下面这样尝试过,但得到了相同的结果.

                  I have also tried like below, but got same result.

                  JFactory::getMailer()->sendMail($from,$fromname,$buyerEmail, $subject, $body);
                  

                  我在邮件中得到的输出是:

                  the output I got in the mail is:

                  <p>Hello Test F,</p><br/><p>Thank you for registering at Deals&offers. Your account is created and activated.</p><br/>You may login to http://server.ashoresystems.com/~dealsand/index.php using the following username and password:</br><p>Username: rowdy</p><p>Password: lX1XZghF/p><br/><p><b>Note:</b> It is recomended to change your password after first login.</p>
                  

                  我不确定我做错了什么.如果有人有任何解决方案,请帮忙.

                  I am not sure what I am doing wrong. If anyone has any solution please help.

                  推荐答案

                  试试这个..

                  对于你的第一种方法......你必须设置

                  For your first method...You have to set

                  $mailer->isHTML(true);
                  

                  参考:http://docs.joomla.org/Sending_email_from_extensions

                  对于您的第二种方法...

                  For your second method...

                  发送邮件功能:

                  sendMail($from, $fromname, $recipient, $subject, $body, $htmlmode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null )
                  

                  所以你的代码应该是

                  JFactory::getMailer()->sendMail($from,$fromname,$buyerEmail, $subject, $body,true);
                  

                  这篇关于邮件内容在 Joomla 3 中显示为 html 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Joomla 2.5 much faster than Joomla 1.5 Querywise(Joomla 2.5 比 Joomla 1.5 Querywise 快得多吗)
                  How to share Joomla login session from one joomla website to one ASP.Net MVC website(如何将 Joomla 登录会话从一个 joomla 网站共享到一个 ASP.Net MVC 网站)
                  htaccess redirect root to subdirectory but allow index.php in root AND query strings to function(htaccess 将根重定向到子目录,但允许根和查询字符串中的 index.php 起作用)
                  Joomla include database functions(Joomla 包含数据库功能)
                  nl2br() not working when displaying SQL results(显示 SQL 结果时 nl2br() 不起作用)
                  Joomla 2.5 JFactory::getSession(); seems to be caching in firefox(Joomla 2.5 JFactory::getSession();似乎在 Firefox 中缓存)

                  • <tfoot id='xA3BG'></tfoot>
                    • <bdo id='xA3BG'></bdo><ul id='xA3BG'></ul>
                      <i id='xA3BG'><tr id='xA3BG'><dt id='xA3BG'><q id='xA3BG'><span id='xA3BG'><b id='xA3BG'><form id='xA3BG'><ins id='xA3BG'></ins><ul id='xA3BG'></ul><sub id='xA3BG'></sub></form><legend id='xA3BG'></legend><bdo id='xA3BG'><pre id='xA3BG'><center id='xA3BG'></center></pre></bdo></b><th id='xA3BG'></th></span></q></dt></tr></i><div id='xA3BG'><tfoot id='xA3BG'></tfoot><dl id='xA3BG'><fieldset id='xA3BG'></fieldset></dl></div>

                        <small id='xA3BG'></small><noframes id='xA3BG'>

                          <tbody id='xA3BG'></tbody>

                          1. <legend id='xA3BG'><style id='xA3BG'><dir id='xA3BG'><q id='xA3BG'></q></dir></style></legend>