<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 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  • <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>