diff --git a/net/mail/mail.php b/net/mail/mail.php new file mode 100644 index 0000000..c3e0f5f --- /dev/null +++ b/net/mail/mail.php @@ -0,0 +1,34 @@ +'; +$to = $_POST['email']; +$subject = "$name"." event notify"; +$body = "Hi, \n\n$name $event at $time\n\n------------\n\nThis mail is auto generated by mail api."; + +$headers = array( + 'From' => "$from", + 'To' => "$to", + 'Subject' => "$subject" +); + +$smtp = Mail::factory('smtp', array( + 'host' => 'ssl://smtp.gmail.com', + 'port' => '465', + 'auth' => true, + 'username' => 'noreply.watcher@gmail.com', + 'password' => 'YOUR_PASSWORD' + )); +$mail = $smtp->send($to, $headers, $body); + +if (PEAR::isError($mail)) { + echo('

' . $mail->getMessage() . '

'); +} else { + #echo('Email successfully sent!'); +} +?>