|
-
Oct 20th, 2006, 09:07 PM
#1
Thread Starter
Addicted Member
I have a truoble in sending emails
Hello
I use this code to send emails from my website using PHP:
PHP Code:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=windows-1256\r\n";
$headers .= "From: Express English <[email protected]>";
$message = '
<html><body>'
. 'Hello' .
'</body></html>';
mail (to,subject,$message,$headers);
It was working for a while as well, but today it wasn't working any more.
No emails have been sent.
What's problem?
Please
Last edited by onh1986; Oct 20th, 2006 at 10:03 PM.
-
Oct 20th, 2006, 10:13 PM
#2
Re: I have a truoble in sending emails
if it was working before and isn't now, it's probably something to do with your host. if you have a free host, they might have turned off your ability to send email because you're sending too many, or something like that. if you don't have a free host, then you should talk to their tech support about it.
-
Oct 20th, 2006, 10:16 PM
#3
Re: I have a truoble in sending emails
Also you have not specified the email address(es) to be sent to or the subject.
This line
PHP Code:
mail (to,subject,$message,$headers);
should be
PHP Code:
mail ($to,$subject,$message,$headers);
-
Oct 20th, 2006, 10:29 PM
#4
Thread Starter
Addicted Member
Re: I have a truoble in sending emails
My website isn't free and I know it's "$to" not "to".
But If I removed $headers value, it works well.
why?
-
Oct 20th, 2006, 10:35 PM
#5
Re: I have a truoble in sending emails
This is how I send emails in PHP which works fine each time.
PHP Code:
$headers .= "From: [email protected]\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1";
mail ("$to", "My Subject", "$message", "$headers");
-
Oct 20th, 2006, 10:45 PM
#6
Thread Starter
Addicted Member
Re: I have a truoble in sending emails
It isn't working if I used $headers value.
-
Oct 21st, 2006, 09:22 AM
#7
Thread Starter
Addicted Member
Re: I have a truoble in sending emails
Now, I've just tried to remove the line:
PHP Code:
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
So now I use the code:[
PHP Code:
$headers .= "From: Express English <[email protected]>";
$msg = "
Thank you for registering at My Website Name.
The purpose of this confirmation message is to verify that the email address you submitted is valid and reachable.
We are working hard to keep the confirmation process as simple as possible.
To complete your registration, please visit this URL:
mail ($to,"Membership Activattion",$msg,$headers);
Now it's working perfectly.
Why it doesn't work if I removed the line above?
-
Oct 23rd, 2006, 04:52 AM
#8
Addicted Member
Re: I have a truoble in sending emails
Hmmm...
If you want to use header.. you can try :
PHP Code:
$Headers = "MIME-Version: 1.0\nContent-type: text/plain; charset=iso-8859-1\nFrom: \"YOUR SITE\"<YOUR-EMAIL>\nReply-To: \"YOUR SITE\" <YOUR-EMAIL>\nX-Priority: 3\nX-Mailer: PHP 4\n";
$Subject = "Email Subject";
$Content = "Email Message Content";
$To = "[email protected]";
mail($To, $Subject, $Content, $Header);
Last edited by mfurqan; Oct 23rd, 2006 at 04:55 AM.
Muhammad Furqan Attari.
-
Oct 24th, 2006, 05:39 AM
#9
Thread Starter
Addicted Member
Re: I have a truoble in sending emails
It isn't working
Nothing has been sent.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|