EvilZone

Programming and Scripting => Web Oriented Coding => : pllaybuoy October 28, 2012, 02:21:20 PM

: Whats the definition of php mail function ?
: 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++
: Re: Whats the definition of php mail function ?
: Snayler October 28, 2012, 02:48:12 PM
Really? PHP mail function. (http://lmgtfy.com/?q=php+mail+function)
: Re: Whats the definition of php mail function ?
: pllaybuoy October 28, 2012, 03:13:06 PM
Yah , but any explanation that how does a simple function makes it ways thru the protocols  ?
: Re: Whats the definition of php mail function ?
: Stackprotector October 28, 2012, 03:16:38 PM
Yah , but any explanation that how does a simple function makes it ways thru the protocols  ?
Using the default mail application on the server.
: Re: Whats the definition of php mail function ?
: pllaybuoy October 28, 2012, 04:07:55 PM
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 );
 
?>

: Re: Whats the definition of php mail function ?
: p_2001 October 28, 2012, 04:34:34 PM
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.
: Re: Whats the definition of php mail function ?
: pllaybuoy October 28, 2012, 06:16:33 PM
@ p_2001  : Okay , I'll read about that , thanks :)
: Re: Whats the definition of php mail function ?
: kateus October 28, 2012, 07:45:41 PM
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.