简体   繁体   中英

E-mail Responder

Hey, I have people registering on my website with their e-mail id. What is the best way to automatically send them e-mails as soon as they register?

<?php

$emailAddress = $_REQUEST['emailFieldName'];
$name = $_REQUEST['nameField'];
$subject = 'Welcome to Website Name';
$fromAddress = 'noreply@mydomain.com';

$messageBody = 'Dear ' . $name;
$messageBody .= "\n" . 'Welcome to my Forum (or whatever)....';
$messageBody .= 'Add more lines using $messageBody .='; 

mail($emailAddres, $subject, $messageBody, 'From: ' . $fromAddress);
?>

Read their email address from the proper post field when your registration form is submitted. Create an email object and send it to the email address. It's likely that no one will just hand you code unless you actually give it a shot yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM