PDA

View Full Version : Email


norbert_ds
02-13-2009, 06:04 AM
Hi,

I'm trying to send out a simple emailer from my PHP page I am using XAMPP server (for mySQL, Apache & PHP on windows XP Pro) with the following code:

<?php include('class.phpmailer.php');
include('class.smtp.php');

//process the email
if(array_key_exists('send', $_POST))
{
$to = $row_EmailVerification['Username'];
$subject = 'feedback';
$from = 'admin';
$message = 'Test';

//send it
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$mailsent = mail($to, $subject, $message, $from, $headers);
}

?>

I'm not sure what i'm doing wrong.

1. I'm not sure if including class.mailerphp is the wrong thing because I don't know why I need to be using it in the first place. Just read that it is a good class for mail so I downloaded it and placed it in the htdocs folder.

2. I'm also not sure what the $headers does.

Can anybody in the know explain this please?

Thanks in advance.

Regards
Norbert

edbr
02-13-2009, 06:38 AM
$headers is part of the code to send an html mail,
you need the class to i gues, to actually send mail or there is no mail handler.
it sounds that you are using XAMPP on a local server which is why nothing is happening

norbert_ds
02-13-2009, 06:49 AM
Hi Ed,

Thanks for your response.

So is XAMPP the problem or is running it on a local server the problem!!

Regards
Norbert

edbr
02-13-2009, 07:32 AM
local server. you have to have a mail server to send mail

norbert_ds
02-13-2009, 08:16 AM
Thanks Ed,

Sincerely appreciate your prompt responses.

Cheers
Norbert