Results 1 to 9 of 9

Thread: I have a truoble in sending emails

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    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.

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    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); 

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    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?

  5. #5
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    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"); 

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    Re: I have a truoble in sending emails

    It isn't working if I used $headers value.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    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?

  8. #8
    Addicted Member mfurqan's Avatar
    Join Date
    Oct 2005
    Location
    Pakistan
    Posts
    176

    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.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    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
  •  



Click Here to Expand Forum to Full Width