Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
mail() function help in php
Old 04-10-2009, 12:12 PM mail() function help in php
Average Talker

Posts: 15
Name: taylor
Trades: 0
i have yet to work with the mail function in php and don't really have a clue whats going on. i tried this simple script. it outputs message successfully sent, but i get nothing at my gmail account. i'm very sure i missing a few steps??? what should a working script look like?? new to php

Thanks,
Taylor

<?php
$to = "th71852@gmail.com";
$subject = "Hi!";
$body = "Hi, How are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
antioch1st is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-10-2009, 12:51 PM Re: mail() function help in php
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Even though the header parameter is optional in the mail function, most email services will filter out email that does not specify From: in the headers. Here is the example from php.net:
PHP Code:
$to      'nobody@example.com';
$subject 'the subject';
$message 'hello';
$headers 'From: webmaster@example.com' "\r\n" .
    
'Reply-To: webmaster@example.com' "\r\n" .
    
'X-Mailer: PHP/' phpversion();

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

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 04-10-2009, 08:09 PM Re: mail() function help in php
Average Talker

Posts: 15
Name: taylor
Trades: 0
ahh, that was simple. that was the problem thanks

Tay,
antioch1st is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to mail() function help in php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11320 seconds with 12 queries