【问题标题】:send data value with email in joomla 2.5?在 joomla 2.5 中通过电子邮件发送数据值?
【发布时间】:2013-04-23 13:16:43
【问题描述】:

我刚刚为 joomla 2.5 创建了一个模块计算器。我想将用户输入的信息发送到一个电子邮件地址

<div class="formRow">
<label id="jform_varListCarburant-lbl" for="jform_varListCarburant" class=""><?php echo JText::_("MOD_MODULESCASCODEVIS_EN_LIGNE_VARLISTCARBURANT"); ?></label>
<select id="jform_varListCarburant" name="jform[varListCarburant]" class="">
    <option value="0" selected="selected" <?php if($varListCarburant=="0") echo "selected=\"selected\"" ?>><?php echo JText::_("Choisir"); ?></option>
    <option <?php if($varListCarburant=="1") echo "selected=\"selected\"" ?> value="1">Essence</option>
    <option <?php if($varListCarburant=="2") echo "selected=\"selected\"" ?> value="2">Diesel</option>
</select>

</div> 

计算器变量:

$varListCarburant = isset($form["varListCarburant"]) ? $form["varListCarburant"] : "";

$varListCarburant = preg_replace('/[^0-9.\-]/', '', str_replace(',', '.', $varListCarburant));

$varListPuissance = isset($form["varListPuissance"]) ? $form["varListPuissance"] : "";

$varListPuissance = preg_replace('/[^0-9.\-]/', '', str_replace(',', '.', $varListPuissance));

$varListUsage = isset($form["varListUsage"]) ? $form["varListUsage"] : "";

$varListUsage = preg_replace('/[^0-9.\-]/', '', str_replace(',', '.', $varListUsage));

$varListEtatvoiture = isset($form["varListEtatvoiture"]) ? $form["varListEtatvoiture"] : "";

$varListEtatvoiture = preg_replace('/[^0-9.\-]/', '', str_replace(',', '.', $varListEtatvoiture));

【问题讨论】:

标签: php email joomla send calculator


【解决方案1】:
 $mailer = JFactory::getMailer();
        $mailer->setSender(array($fromemail, 'Your mail text'));
        $mailer->addRecipient($toemail);
        $mailer->setSubject($subject);
        $mailer->setBody($body);
        $mailer->IsHTML(false);
        $mailer->Send();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-10
    • 1970-01-01
    • 2020-12-21
    • 1970-01-01
    • 2014-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多