Joomla 使用 JUtility 发送邮件::发送邮件发件人电子邮件问题



我在Joomla JUtility::sendMail函数中遇到了一个问题

Joomla 文档中提到的函数参数是这样的

问题是我无法设置发件人电子邮件(发件人电子邮件)。当我设置发件人电子邮件并重播为电子邮件时.邮件中显示的电子邮件重播是来自joomla管理员配置电子邮件的重播。当我在重播中将另一封电子邮件设置为或发件人电子邮件时,每次使用来自 joomla 管理员配置的电子邮件时,它都没有采取正确的电子邮件。

我从谷歌得到了一个几乎相同的参考,但我尝试过它不起作用。

我正在使用Joomla 1.7

我试过

$your_email //can be array but here string one email
$your_name //name i will work fine
$user_email //admin email
$subject //subject
//last two argument is reply to and replay name Its showing inside mail but click on replay it will admin config email.
JUtility::sendMail($your_email, $your_name, $user_email, $subject, $fcontent,1,NULL,NULL,NULL,$your_email,$your_name);

任何帮助将不胜感激。

像这样尝试

$mailer =& JFactory::getMailer();

添加发件人信息。

$sender = array( 
    $your_email,
    $your_name
);
$mailer->setSender($sender); 

添加收件人。 $recipient = $user_电子邮件;

$mailer->addRecipient($recipient);

添加主题

$mailer->setSubject('Your subject string');

添加正文

$mailer->setBody($fcontent);
$send =& $mailer->Send();
if ( $send !== true ) {
    echo 'Error sending email: ' . $send->message;
} else {
    echo 'Mail sent';
}

大功告成。有关详细信息,请参阅此链接从扩展发送电子邮件。

我认为这可能会对你有所帮助。

最新更新