Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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";
} ?>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now