Problem with sending mail

the mail() function

Moderators: macek, egami, gesf

makarakao
New php-forum User
New php-forum User
Posts: 51
Joined: Wed Aug 24, 2005 2:10 am
Contact:

Problem with sending mail

Postby makarakao » Sun Feb 19, 2006 6:15 pm

Hi there!

I have a sendmail file uploaded to the hosting server and the code is:

Code: Select all

$to = "personstays@yahoo.com";
$headers = "From: Makara";
$subject="Hello";
$message="test";
$succeed=mail($to, $subject, $message,"MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n".$headers);
if(!$succeed)die("The mail does not function!");
header("location: index.php?message=succeed!");


And when I test it, there is no error message coming out.
However I can't get the message, even though I wait for it for a long time.

Hope someone can help me solve this problem.
Thanks in advance.

Makara Kao

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon Feb 20, 2006 12:51 pm

From header should conin an email address as otherwise it might be blocked.
try something like

Code: Select all

From: Makara <makara@mail.com>


or somthing simmilar

makarakao
New php-forum User
New php-forum User
Posts: 51
Joined: Wed Aug 24, 2005 2:10 am
Contact:

Postby makarakao » Thu Mar 23, 2006 6:04 pm

Thank you, Alexei for your replay!

I will follow this suggestion from now on.

Kindly Regards,
Makara Kao


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest