Unable to send mail

Discussion in 'PHP' started by cris02, Oct 30, 2006.

  1. #1
    Hello i would like to ask what is the problem on this code why i can't send mail..

    here's my code:
    
    $towhom = "someone@mydomain.com";
    $todayis = date("l, F j, Y, g:i a");
    $attnn = "Test"; 
    $subjects = $attnn;
    $from = "admin@mydomain.com";
    $messages = "$todayis [EST] \n
    Hello \n
    ";
    mail($towhom, $subjects, $messages, $from);
    
    PHP:
    on my php.ini
    
    [mail function]
    ; For Win32 only.
    SMTP = smtp.mydomain.com ; for Win32 only
    smtp_port = 25
    sendmail_from= admin@mydomain.com ; for Win32 only
    
    Code (markup):
    i'm working on IIS 6, OS windows server 2003

    thanks for the help.
     
    cris02, Oct 30, 2006 IP
  2. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #2
    You'll need to tell us what errors you're getting, everything looks fine to me.
     
    sketch, Oct 31, 2006 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    mail is a program that runs only on linux based systems. If you want to use email on IIS You will need to use SMTP instead.

    Peace,
     
    Barti1987, Oct 31, 2006 IP
  4. steb

    steb Peon

    Messages:
    213
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    you might want to try getting a class from phpclasses.org and using that instead, its probably more foolproof than the standard mail() call
     
    steb, Nov 1, 2006 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    Try using the phpmailer class.

    phpmailer.sourceforge.net
     
    nico_swd, Nov 1, 2006 IP