-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.php
32 lines (27 loc) · 1004 Bytes
/
mail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
error_reporting(0);
$to=base64_encode("[email protected]");
$toname=base64_encode("Blaaze Maharshi");
$subject=base64_encode("hi this is the subject");
$body=base64_encode("<h3><i>Welcome to Snapheap</i></h3><br/>here is the activation link to your account on snapheap.<hr/>© SnapHeap 2012");
$url="http://localhost/xampp/phpmailer/examples/snapheapmailer.php";
$fields = array(
'to' => urlencode($to),
'toname' => urlencode($toname),
'subject' => urlencode($subject),
'body' => urlencode($body)
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//execute post
$result = curl_exec($ch);
echo $result;
//close connection
curl_close($ch);
?>