我有一个登录页面,我想直接将注册信息直接发送到我的电子邮件中,或者将其保存在一些excel文件中
// send data to some get post API , if so uncomment next code and customize for your needs
$myvars = 'publicid=' . $publicid . '&firstname=' . $firstname . '&lastname=' . $lastname . '&email=' . $email . '&phone=' . $phone . '&country=' . $selected_country . '&leadsource=' . $leadsource[0] . '&ip=' . $ip;
$url = "#";
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
var_dump($response);
echo '{"success":true,"message":{"message":"lead insert"}}';
?>
答案 0 :(得分:0)
所以您想做2件事,这已经在stackoverflow中问过了,请阅读这2页:
根据您的数据生成一个excel: PHP create Excel spreadsheet and then email it as an attachment
发送带有附件的电子邮件: send email with attachment using php