Jump to content

mail wont work


patchido

Recommended Posts

well, i have a hosting site and i enter via cpanel,(just in case it matters)

 

and i am trying to use the mai() function but it won't work.. :S

 

 

this is my code

 

<?php
$to = "pato.llaguno@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }
?>

 

 

the output is

 

Message successfully sent!

 

 

but i don't get any mail in the adress specified :S

 

Link to comment
https://forums.phpfreaks.com/topic/249370-mail-wont-work/
Share on other sites

<?php
$to      = 'pato.llaguno@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

if(mail($to, $subject, $message, $headers)){
echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }
?>

 

 

same thing :S

Link to comment
https://forums.phpfreaks.com/topic/249370-mail-wont-work/#findComment-1280423
Share on other sites

<?php 
   $from    = "PHP Freak";
   $headers = "MIME-Version: 1.0\r\n";
   $headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
   $headers.= "From: $from\r\n";

   $to = "pato.llaguno@gmail.com"; 
   $subject = "Email send!"; 
   $body = "Hi,Email working?"; 
   if (mail($to, $subject, $body,$headers)) 
  {   echo("<p>Message successfully sent!</p>");  } 
  else 
{   echo("<p>Message delivery failed...</p>");  }


?>


Link to comment
https://forums.phpfreaks.com/topic/249370-mail-wont-work/#findComment-1280426
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.