EvilZone
Programming and Scripting => Web Oriented Coding => : pllaybuoy October 28, 2012, 02:21:20 PM
-
this
mail();
whats its DEFINITION ?
I mean seriously how can php be soo easy ? :/ you send an email just by a prebuilt function ? No messing with the tcp/ip protocols or pop3 ? How could this be ? I really need the definition to this function , gonna try to rewrite in c++
-
Really? PHP mail function. (http://lmgtfy.com/?q=php+mail+function)
-
Yah , but any explanation that how does a simple function makes it ways thru the protocols ?
-
Yah , but any explanation that how does a simple function makes it ways thru the protocols ?
Using the default mail application on the server.
-
But it doesn't require you to LOGIN to an email account and just sends an email randomly
<?php
$email = $_POST['email'];
$content = nl2br($_POST['content']);
$name = $_POST['name'];
$sender = $_POST['sender'];
$subject = $_POST['subject'];
$headers = "From: $name "."<".$sender.">\r\n";
//add boundary string and mime type specification
//$headers .= 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//send the email
mail($email, $subject, $content, $headers );
?>
-
But it doesn't require you to LOGIN to an email account and just sends an email randomly
<?php
$email = $_POST['email'];
$content = nl2br($_POST['content']);
$name = $_POST['name'];
$sender = $_POST['sender'];
$subject = $_POST['subject'];
$headers = "From: $name "."<".$sender.">\r\n";
//add boundary string and mime type specification
//$headers .= 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//send the email
mail($email, $subject, $content, $headers );
?>
Emails don't need a login account...
Read SMTP..
You can send email by implementing the protocol.
-
@ p_2001 : Okay , I'll read about that , thanks :)
-
Yeah, if you have your own smtp server, and are sending mail from that server you don't need login info. If you want to send mail using a remote smtp server, like say google's, you generally have to send a username and password.