p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Help!! Can't get mail( ) object to work on Windows 2000


Message #1 by dougwood@a... on Sat, 6 Apr 2002 08:44:52
Man, I've tried just about everything I can think of to get this script to 
work, and it just won't send an e-mail.
anyone have a clue as to what i am forgetting?
My other php scripts work fine on the server, but not email( ).
I tried changing the SMTP from 'localhost', to my actual server name, in 
the php.ini file, with no luck eihter.


here's the script:

<?
$ToEmail = "dougwood@a...";

$ToName = "doug";
$ToSubject = "Example Mail from SendMail Tutorial";

$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nSenders Company: 
$Company\n\nMessage Sent:\n$ToComments\n\nSender Heard About Site From: 
$HearAbout\n";

$EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If 
you feel that you recieved this e-mail by accident please contact us at 
www.somesite.com";

$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." 
<".$Email.">");


Print "_root.Mail.EmailStatus=Complete - Your mail has been sent";

?>

can anyone she some light???
Message #2 by "Vick Ahuja" <indian_jedi@h...> on Mon, 15 Apr 2002 08:51:12
Your script works fine.  The SMTP in your php.ini file needs to bounce 
off a mail server. Something like...

SMTP = smtp.attbi.com

should work.



[mail function]
; For Win32 only.
SMTP = smtp1.sympatico.ca

> Man, I've tried just about everything I can think of to get this script 
to 
w> ork, and it just won't send an e-mail.
a> nyone have a clue as to what i am forgetting?
M> y other php scripts work fine on the server, but not email( ).
I>  tried changing the SMTP from 'localhost', to my actual server name, 
in 
t> he php.ini file, with no luck eihter.

> 
h> ere's the script:

> <?
$> ToEmail = "dougwood@a...";

> $ToName = "doug";
$> ToSubject = "Example Mail from SendMail Tutorial";

> $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nSenders 
Company: 
$> Company\n\nMessage Sent:\n$ToComments\n\nSender Heard About Site From: 
$> HearAbout\n";

> $EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR 
If 
y> ou feel that you recieved this e-mail by accident please contact us at 
w> ww.somesite.com";

> $Message = $EmailBody.$EmailFooter;

> mail($ToName." <".$ToEmail.">",$ToSubject, 
$Message, "From: ".$FirstName." 
<> ".$Email.">");

> 
P> rint "_root.Mail.EmailStatus=Complete - Your mail has been sent";

> ?>

> can anyone she some light???

  Return to Index