Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

I don't know what i'm doing wrong...

the mail() function

Moderators: macek, egami, gesf

I don't know what i'm doing wrong...

Postby VBSteve » Tue Jan 13, 2004 10:38 am

I've been trying to get the mail function to work for several days now and i always get the same message:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in d:\server_applications\root\http\t1.php on line 6

Although sendmail_from is set and the "From" header is set also...
And i'm running my own SMTP server (localhost)

This is what i have in my php.ini:
[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = system@jpstuff.servehttp.com


This is what i have in my source code:
<?php
echo "test: Start sending mail";
$address = "admin@jpstuff.servehttp.com";
$subject = "test - Subject line";
$body = "Mail body";
$mailsend = mail("$address","$subject", "$body", "system@jpstuff.servehttp.com");
print ("$mailsend");
echo "done";
?>


Anyone has a sollution for this problem?
Thanks.
VBSteve
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Jan 13, 2004 10:25 am

Postby bezmond » Tue Jan 13, 2004 11:18 am

Try this:
<?php
echo "test: Start sending mail";
$address = "admin@jpstuff.servehttp.com";
$subject = "test - Subject line";
$body = "Mail body";
mail($address,$subject, $body, "From: Automated Mailer <system@jpstuff.servehttp.com>");
echo "done";
?>
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby VBSteve » Wed Jan 14, 2004 4:35 am

It didn't work. I still get the same warning message :?
VBSteve
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Jan 13, 2004 10:25 am

Postby bezmond » Wed Jan 14, 2004 10:13 am

in php.ini, try: sendmail_from = "system@jpstuff.servehttp.com"
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby VBSteve » Wed Jan 14, 2004 11:52 am

It didn't work either.

But i reinstalled PHP with and the problem seems to be solved.
Thanks! :)
VBSteve
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Jan 13, 2004 10:25 am

Postby bezmond » Wed Jan 14, 2004 12:33 pm

No problem........ at least it's working now :D

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK


Return to PHP coding => Mail

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.