Jump to content

how to use mail()?


homer.favenir

Recommended Posts

hi,

i have already a script but its not working...

<?php

$to = "diyos_ako@yahoo.com";

$subject = "Test mail";

$message = "Hello! This is a simple email message.";

$from = "homer.favenir@gmail.com";

$headers = "From: $from";

mail($to,$subject,$message,$headers);

echo "Mail Sent.";

?>

 

i run it on my localhost but there is an error:

 

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port".

 

how can i fixed this?

 

thanks

???

Link to comment
Share on other sites

<?php

  //send email

  $email = "homer.favenir@gmail.com" ;

  $subject = $_REQUEST['email'] ;

  $message = $_REQUEST['password'] ;

  mail( $email, $subject, $message);

?>

 

but it returned error

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\friendster\index.php on line 477

 

thanks ???

Link to comment
Share on other sites

and i have this script.

<?php

$to = "homer.favenir@asecph.com";

$subject = "Test mail";

$message = "Hello! This is a simple email message.";

$from = "homer.favenir@gmail.com";

$headers = "From: $from";

mail($to,$subject,$message,$headers);

echo "Mail Sent.";

?>

it only echoed "mail sent"

but i dont received any  message from the specific email above...

???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.