You are here: Re: php mail() issues « PHP Programming Language « IT news, forums, messages
Re: php mail() issues

Posted by ctclibby on 12/17/17 11:49

Chris wrote:
[snip]

> Trying a real simple example like this...
>
> <? phpinfo();
> mail('mail@myaddress.com','test','message'); ?>

Hi Chris.

I had problems with this also. Don't know if my solution will work or
not, but. Here is the code I used. Note that it is pieces of stuff
that I played with until it worked. Your mileage may vary.
<?php
include("DB.php");
.....
$MailTo = 'emailname@domainname.tld';
$Subject = 'Some subject here';
$MailBody = 'What ever is the text you wish to send';
$headers = "From: me@mydomain.tld";
.....
?>
I fussed with this for a few hours until I found that 'header' stuff.
I then wrapped it in an 'if' statement.

if(mail($MailTo, $Subject, $MailBody, $headers) ) {
do something here.
} else {
oooops. do something drastic here
}

Hope that helps

todh

Oh FC5, php 5.14, sendmail 8.13.latest

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация