sending mail in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • student1
    New Member
    • Nov 2006
    • 3

    sending mail in php

    i want to send an automatic mail .how to tht in a php script.i can use mail() fuction but it is not working.what type configuration i should do.please tell
  • billkirim
    New Member
    • Nov 2006
    • 25

    #2
    [php]$to = "bilkirim@yahoo .gr";
    $subject = "Hello Bill";
    $body = "type your text here";
    if (mail($to, $subject, $body))
    {
    echo("<p>Messag e successfully sent!</p>");
    }
    else
    {
    echo("<p>Messag e delivery failed...</p>");
    }
    [/php]
    You have to make some changes to your php.ini file..
    [mail function]
    ; For Win32 only.
    SMTP = your_mail_domai n
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = bilkirim@themus icase.com //yout mail

    i have my own mail domain.. i don't think that it works with yahoo,hotmail mails but i am not sure.

    Comment

    • glady
      New Member
      • Nov 2006
      • 23

      #3
      I am having the same problem, but i am using unix sendmail program and the mail server is exim 3.36.
      Could you help with php mail() program?
      Thanks

      Comment

      • billkirim
        New Member
        • Nov 2006
        • 25

        #4
        Originally posted by glady
        I am having the same problem, but i am using unix sendmail program and the mail server is exim 3.36.
        Could you help with php mail() program?
        Thanks
        i think it is the same code..
        the only differense is in the php.ini file.
        you have to add this line
        sendmail_path = (your sendmail path)

        Comment

        • billkirim
          New Member
          • Nov 2006
          • 25

          #5
          sorry i forgot.. You have to restart your server to apply the changes..

          If it is apache.
          c:\(apache path)\apache -k restart

          Comment

          • glady
            New Member
            • Nov 2006
            • 23

            #6
            Originally posted by billkirim
            sorry i forgot.. You have to restart your server to apply the changes..

            If it is apache.
            c:\(apache path)\apache -k restart
            Do i need to give in command line,
            do i need to go to shell prompt and give the path of php.ini file and restart?
            like.....
            myusername@sand box:~\etc\php4\ apache\php.ini -k restart
            Thanks

            Comment

            • billkirim
              New Member
              • Nov 2006
              • 25

              #7
              Originally posted by glady
              Do i need to give in command line,
              do i need to go to shell prompt and give the path of php.ini file and restart?
              like.....
              myusername@sand box:~\etc\php4\ apache\php.ini -k restart
              Thanks
              No Apache look automatic for Your Php.ini File..
              It is Stored to Your System Direcory.
              The only thing you have to do is.
              to go to your apache folder (where you biuld apache)
              if you don't know search for the Apache.exe file
              it mostly be in a \bin\ directory
              and then
              myusername@sand box:~\etc\www\a pache\bin\apach e -k restart

              Comment

              • glady
                New Member
                • Nov 2006
                • 23

                #8
                Originally posted by billkirim
                No Apache look automatic for Your Php.ini File..
                It is Stored to Your System Direcory.
                The only thing you have to do is.
                to go to your apache folder (where you biuld apache)
                if you don't know search for the Apache.exe file
                it mostly be in a \bin\ directory
                and then
                myusername@sand box:~\etc\www\a pache\bin\apach e -k restart
                I found the path of the server and restarted the server, but still it doesnt work.
                Will the problem be in the
                sendmail_path=
                do i need to give explicitly the path or will it take the default value?
                the default value is "sendmail -t -i"
                Is it possible to open and read sendmail program?

                Comment

                Working...