<?php $to = "Name1 <[email protected]>"; // Recipient $subject = "Hi there!"; // Email Subject $message = "Hi, how are you today?"; // Email body $header = "From: Name2 <[email protected]>rnReply-to: Name2 <[email protected]>n"; $header .= "MIME-Version: 1.0ln"; $add = "-f [email protected]"; mail($to, $subject, $message, $header, $add); ?>
Simply replace the data in red with whatever you require. You will be able to send an email to anyone you want and make it look like it’s coming from anyone you like.
The $add variable is very important since it will mask the server from which you’ve sent the email.