Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Send a welcome email

New Here ,
May 02, 2011 May 02, 2011

Hi Guys

I am creating a site which allows the registration of new  users. I already have my user registration page up and running which is  lnked to my database.

I would now like to add a function which  will send a 'welcome to...' email to the email address provided on the  registration form provided by the new user.

Could anybody please point me in the right direction i.e where to start?

I am using dreamweaver and Cpanel.

Thanksin advance

TOPICS
Server side applications
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2011 May 02, 2011

Just use the PHP Mail function in your script when they sign up:

http://php.net/manual/en/function.mail.php

You'll get the address from the form and then include your message.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 02, 2011 May 02, 2011
LATEST

how about something like this:

<?php if (!isset($_POST['submit'])); { ?>
  
            <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
                <table border="0">
          <tr>
            <td>Your Return Email: </td>
            <td><?php echo $row_rsUser['userEmail']; ?></td>
          </tr>
          <tr>
            <td>Subject: </td>
            <td><label>
              <input name="emailSubject" type="text" id="emailSubject" size="32" />
            </label></td>
          </tr>
          <tr>
            <td> </td>
            <td><label>
              <textarea name="emailText" cols="32" id="emailText"></textarea>
            </label></td>
          </tr>
          <tr>
            <td> </td>
            <td><label>
              <input type="submit" name="submit" id="submit" value="Send" />
            </label></td>
          </tr>
        </table> 
            </form>
   <?php } ?>

   <?php
   if (isset($_POST['submit'])) { 
  
   // send e-mail to ...
$to= "replace this with where you want the email to go";

// Your subject
$subject= $_POST['emailSubject'];

// From
$header="from: your from address";

// Your message
$messages= $_POST['emailSubject'];

// send email
$sentmail = mail($to, $header, $subject,$messages);

}

// if your email succesfully sent
if($sentmail){
echo "Status: Your Question Has Been Sent.";
}
else {
echo "Status : Message Not Sent";

} ?>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines