You are here: Re: PHP mail « PHP « IT news, forums, messages
Re: PHP mail

Posted by Mathieu Dumoulin on 05/05/05 17:52

Eustace wrote:
> I am relatively new to PHP and could use some help. I have a form, which is
> basically in an email format, from, subject, and message. How do I then send
> this to an email? I know a bit about the mail function, somebody show me the
> ropes please!
>
> Eustace

I'll show you how we do it here at work, its quite simple:

//Target message setup
$target_receptemail = 'insert email here';
$target_receptname = 'insert the targets name here';
$target_senderemail = 'insert your email here';
$target_sendername = 'insert your name here';

//Message body setup
//Target setup
$target_bodymsg = 'Insert content here';
$target_subjectmsg = 'Insert subject here';

//Build the headers
$headers = array(
'From: '.$target_sendername.' <'.$target_senderemail.'>',
'Content-Type: text/html'
);

//Send the mail
mail(
$target_receptemail,
$target_subjectmsg,
$target_bodymsg,
implode("\r\n", $headers)
);

 

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

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