Results 1 to 15 of 15

Thread: [RESOLVED] Problem in sending emails

  1. #1

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

    Resolved [RESOLVED] Problem in sending emails

    Hello
    I have a website and I have email named "[email protected]".
    I'm trying to send emails from it by PHP page.

    I was using this code:
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=windows-1256\r\n";
    $headers .= "From: My Name <[email protected]>\r\n";
    $to = The email which I wanna send to... (Hotmail email).
    $message = "<html><body><p align=center>Hello</p></body></html>";
    mail ($to,"Subject",$message,$headers);

    Since days, it was working but now it can't send emails.
    Emails never come to receivers.

    What's problem, please?
    I need help.

    Thanks & Regards

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Problem in sending emails

    Does it work if you try sending it to another email address?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

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

    Re: Problem in sending emails

    no, it never works even I if used other addresses.
    Last edited by onh1986; Jun 11th, 2006 at 11:54 PM.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Problem in sending emails

    At the top of the script, put the following line. See if you get any errors:
    PHP Code:
    error_reporting(E_ALL); 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

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

    Re: Problem in sending emails

    No errors found.

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Problem in sending emails

    Well that rules out a problem with PHP. Is this a Windows or UNIX system? If it is Windows, what SMTP server are you using?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  7. #7

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

    Re: Problem in sending emails

    Windows XP.
    My smtp I use is "mail.onh1986.com"

  8. #8
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Problem in sending emails

    have you changed the PHP.ini (ini_set()) file value for the smtp server to use mail.onh1986.com?

  9. #9

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

    Re: Problem in sending emails

    How can I change it.
    I mean how I can find PHP.ini file and what the code I have to write is.

    Thanks

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Problem in sending emails

    The php.ini file ought to be in your PHP installation location. You can just edit it with a text editor. Search for the phrase "smtp" and follow the instructions in the comments.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Problem in sending emails

    Check out these links for info about php.ini. The file is normally in the same folder as the PHP binary file or for windows in the Windows or Winnt folder.

    http://uk2.php.net/manual/en/ini.php#ini.list
    http://uk2.php.net/manual/en/ref.mail.php#ini.smtp

  12. #12

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

    Re: Problem in sending emails

    OK
    I couldn't find PHP.ini file in my website.
    How can I edit it?

    Thanks

  13. #13
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Problem in sending emails

    Just use ini_set(). You can find thel ocation of php.ini by calling phpinfo() function.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  14. #14

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

    Re: Problem in sending emails

    Thanks.
    It works now.

  15. #15
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: [RESOLVED] Problem in sending emails

    i know the thread starter has mark this thread as resolved but i don't want to create a new thread since i'm also having the same problem.

    it's not working for me(even after i went through and follow all the given step(s)
    i'm on Window XP Pro and i run my scripts locally.

    pls help...
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

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