2013-04-29 64 views
-2

我刚刚为joomla 2.5创建了一个模块计算器。我想通过用户输入的信息发送到电子邮件地址用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)); 
+0

欢迎SO和感谢分享这个美妙的想法..,虽然这个职位被拒绝投票并可能关闭,请去[FAQ](http://stackoverflow.com/faq)阅读。 – dbf 2013-04-29 18:48:57

+1

请阅读本文,请:http://stackoverflow.com/a/16278454/632407 – kobame 2013-04-29 18:58:15

回答

0
$mailer = JFactory::getMailer(); 
     $mailer->setSender(array($fromemail, 'Your mail text')); 
     $mailer->addRecipient($toemail); 
     $mailer->setSubject($subject); 
     $mailer->setBody($body); 
     $mailer->IsHTML(false); 
     $mailer->Send();