php向用户发送电子邮件确认注册,PHP确认电子邮件

我的网站上有注册表格。完成后,详细信息存储在CSV文件中,但我也想向用户发送确认电子邮件。问题是电子邮件空白,我所做的是创建了一个template.php文件,其中包含我要发送的电子邮件结构,在此模板结构中,我有来自确定注册日期的其他文件的功能。 template.php中的模板包含在我在from_to_csv.php中调用的函数中,作为mail()atrebiutes的一部分:

希望这是有道理的,你们理解我看看代码:

的template.php:

function getMailContent(){

$subject = "OPES Academy- Workshop confirmation";

$message = "

logo.png

width='100' alt='Opes Academy'>

KNOWLEDGE | WEALTH | POWER

Thank you for reserving your place

Thanks for your registration, we will be looking forward to see you at the";

?>

require('helper.php');

echo ConvertDate( $_SESSION['date'] );

?>

$message.="

Address: 6 Thomas More Square, London, E1W 1XZ

If you have any more questions we will be glad to help you, just call us on 020 3675 9000 or email us on

support@opesacademy.com

Trading and investing often

involves a very high degree of risk. Past results are

not indicative of future returns and financial instruments can go down as well as up

resulting

in you receiving less than you invested. Do not assume that any recommendations, insights,

charts, theories, or philosophies will ensure profitable investment. Spread betting, trading

binary options and CFD's carry a high risk to your capital, can be very volatile and prices

may

move rapidly against you. Only speculate with money you can afford to lose as you may lose

more

than your original deposit and be required to make further payments. Spread betting may not

be

suitable for all customers, so ensure you fully understand the risks involved and seek

independent advice if necessary

";

$headers = "Content-type: text/html\r\n";

return compact($subject, $message, $headers);

}

?>

form_to_csv.php:

$to = $data['email'];

require('template.php');

$mailContent = getMailContent();

//csv

if(@$_POST['land']=='fw'){

$path='/home/content/24/12131124/html/files/Admin/CSV_Binary/';

$fName=$path.'free_workshop-'.date( "F_j_Y" ).".csv";

//mail($to, $subject, $message, $headers,"-f info@opesacademy.com");

mail($to, $mailContent['subject'], $mailContent['message'], $mailContent['headers'],"-f info@opesacademy.com");

}

$to变量包含用户输入表单的电子邮件.....

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值