[thelist] sending email with php

Gary Bland Gary at star-chaser.com
Sat Sep 7 13:42:01 CDT 2002


Pablo Olivia wrote:
> --
> [ Picked text/plain from multipart/alternative ]
> I am trying to implement the mail function;
>
> Here's the SMTP directive in the php.ini file:
> SMTP = smtp.west.cox.net
> sendmail_from = poliva at cox.net
>
> Here's my code:
>
> $to = $compEmail;
> $subject = 'Jobs on the Road email verification';
> $message = 'test';
>
> if ( @mail( $to, $subject, $message,
> "To: $compContact <$compEmail>\n" .
> "From: poliva at cox.net\n" .
> "MIME-Version: 1.0\n" .
> "Content-type: text/html; charset=iso-8859-1" ) )
> {
> // email sent successfully
> header ( 'Location: ../verify/emailVerification.php?sts=1' );
> }
> else
> {
> // email could not be sent
> header ( 'Location: ../verify/emailVerification.php?sts=0' );
> }
>
> I am being sent to the page that is a result of an unsuccessful attempt.
> Can anyone see any problems with my code, is there something that I am
> missing???? Thanks for any help or light that you could shed on my
> frustrating problem.
>
> --
>

Your not forcing any mail headers. Take the error suppression off of
mail() and it will error out.


$headers .= "From: poliva at cox.net\n";
$headers .= "Reply-To: "bla Bla\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";

mail("whoever at someone.com", $subject, $message, $headers);

do something else


hth
Gary
--
Gary Bland
StarChaser Web Architecture
http://star-chaser.com
Building Tomorrow's World Today




More information about the thelist mailing list