Author Topic: Whats the definition of php mail function ?  (Read 1239 times)

0 Members and 1 Guest are viewing this topic.

pllaybuoy

  • Guest
Whats the definition of php mail function ?
« on: 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++

Offline Snayler

  • Baron
  • ****
  • Posts: 812
  • Cookies: 135
    • View Profile
Re: Whats the definition of php mail function ?
« Reply #1 on: October 28, 2012, 02:48:12 pm »

pllaybuoy

  • Guest
Re: Whats the definition of php mail function ?
« Reply #2 on: October 28, 2012, 03:13:06 pm »
Yah , but any explanation that how does a simple function makes it ways thru the protocols  ?

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: Whats the definition of php mail function ?
« Reply #3 on: 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.
~Factionwars

pllaybuoy

  • Guest
Re: Whats the definition of php mail function ?
« Reply #4 on: 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
Code: [Select]
<?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 );
 
?>


Offline p_2001

  • Royal Highness
  • ****
  • Posts: 684
  • Cookies: -64
    • View Profile
Re: Whats the definition of php mail function ?
« Reply #5 on: 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
Code: [Select]
<?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.
« Last Edit: October 28, 2012, 04:35:26 pm by p_2001 »
"Always have a plan"

pllaybuoy

  • Guest
Re: Whats the definition of php mail function ?
« Reply #6 on: October 28, 2012, 06:16:33 pm »
@ p_2001  : Okay , I'll read about that , thanks :)

Offline kateus

  • Peasant
  • *
  • Posts: 89
  • Cookies: 11
  • scientia potentia est
    • View Profile
Re: Whats the definition of php mail function ?
« Reply #7 on: 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.