Sending a mail using php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kumuda v
    New Member
    • Jul 2007
    • 21

    Sending a mail using php

    Hi all,
    I am new to php, I want to sent mail using php. What are the pre-settings that I am supposed to do. Please help me out.

    With regards,
    kumuda
  • pareshprajapati
    New Member
    • Aug 2007
    • 1

    #2
    just use mail function of php to send a mail.

    You can get details regarding this function on this link
    http://in2.php.net/manual/en/ref.mail.php

    basic steps are,
    - setup smtp server in your php.ini if not set and restart your webserver
    - setup mail parameters in your php program and run

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Hi there,
      Both are welcome to TSDN ! Stay in touch !
      -ajaxrand

      Comment

      • kumuda v
        New Member
        • Jul 2007
        • 21

        #4
        Thank u for the reply. I will try it out.

        Originally posted by pareshprajapati
        just use mail function of php to send a mail.

        You can get details regarding this function on this link
        http://in2.php.net/manual/en/ref.mail.php

        basic steps are,
        - setup smtp server in your php.ini if not set and restart your webserver
        - setup mail parameters in your php program and run

        Comment

        • ak1dnar
          Recognized Expert Top Contributor
          • Jan 2007
          • 1584

          #5
          Originally posted by kumuda v
          Thank u for the reply. I will try it out.
          If there is a problem with your coding, post back the errors and coding snippets back to the thread.
          good luck!

          Comment

          • kumuda v
            New Member
            • Jul 2007
            • 21

            #6
            HI
            I made the changes as given in the table of this link http://in2.php.net/manual/en/ref.mail.php and what are the other changes I am supposed to do. Please help me out.

            Thanks


            Originally posted by pareshprajapati
            just use mail function of php to send a mail.

            You can get details regarding this function on this link
            http://in2.php.net/manual/en/ref.mail.php

            basic steps are,
            - setup smtp server in your php.ini if not set and restart your webserver
            - setup mail parameters in your php program and run

            Comment

            • realin
              Contributor
              • Feb 2007
              • 254

              #7
              Now try to send youself a simple email, to start with and to check if the settings are working correctly..

              [php]
              <?php
              $to=youremail@d omain.com
              $subject="hi this is my first email";
              $msg="this is the body of the email";

              $sent=mail($to, $subject,$msg);

              if($sent)
              echo "mail was sent to $to";
              else
              echo "ERROR: sending the mail";
              ?>[/php]

              yuo can paste the code after making the necessary changes :)

              Comment

              • ak1dnar
                Recognized Expert Top Contributor
                • Jan 2007
                • 1584

                #8
                Originally posted by realin
                Now try to send youself a simple email, to start with and to check if the settings are working correctly..

                [php]
                <?php
                $to=youremail@d omain.com
                $subject="hi this is my first email";
                $msg="this is the body of the email";

                $sent=mail($to, $subject,$msg);

                if($sent)
                echo "mail was sent to $to";
                else
                echo "ERROR: sending the mail";
                ?>[/php]

                yuo can paste the code after making the necessary changes :)
                Try isset() function for :

                [CODE=php] if(isset($sent) ){

                }else{

                }[/CODE]

                Comment

                Working...