PHP, MySQL, Drupal, .htaccess, Robots.txt, Phponwebsites: SMTP
Showing posts with label SMTP. Show all posts

11 Jun 2014

Send mail using php

                       You can send emails using php.

Mail() in php:

                       The mail() in php is used to send mail. The syndex for mail() is:

                    mail(to, subject, message, header)

            to - receiver mail id.
            subject - subject of mail.
            message - message to be sent.
            header - header of mail.

           You can send mail if you are in server. You've to make some changes in php.ini file, if you send mail from local server.

          You've to make following changes in your php.ini file to send mail.
                     [mail function]
                     ; For Win32 only.
                       SMTP =your ISP's mail server address
                       smtp_port = 25

                     ; For Win32 only.

How to send mail using php:

                      The following php script is used for send mail:

   $subject='Send mail using php';
   $message='This mail send using php';
    echo'Mail send successfully';
    echo'Mail is not send';

                      If the the mail is send, then you'll get successful message. Otherwise you'll get 'Mail is not send' message. Now you can see mail in inbox.