mail function

Ecample 1

// Send the email
$to      = $_POST['email'];
$from    = "forgot@gxsam11.net";
$subject = "New password";

$msg     = <<< EOMSG
You recently requested that we send you a new password for
gxsam11.net. Your new password is:

            $password

Please log in at this URL:

             http://gxsam11.net/web/login.php

Then go to this address to change your password:

             http://gxsam11.net/web/changepass.php
EOMSG;

$mailsend = mail("$to","$subject","$msg","From:
  $from\r\nReply-To:gxsam11@gxsam11.net");

 
Example 2

          // Send the confirmation email
          $encoded_email = urlencode($_POST['email']);
          $mail_body = <<<EOMAILBODY
Thank you for registering at www.gxsam11.net. Click this link
to confirm your registration:

http://www.gxsam11.net/web/confirm.php?hash=$hash&email=$encoded_email

Once you see a confirmation message, you will be logged into
www.gxsam11.net
EOMAILBODY;
          mail($email, 'www.gxsam11.net registration confirmation',
            $mail_body, 'From: noreply@gxsam11.net');
          // Give a successful registration message
          $feedback = 'YOU HAVE SUCCESSFULLY REGISTERED.
            You will receive a confirmation email soon';
          return $feedback;
Advertisements

About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Coding, PHP Email and tagged , , . Bookmark the permalink.

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s