Email Form - Adding a name to the "From" email

By depdesign - September 14, 2017 - edited: September 14, 2017

I am using the below snippet in code for sending automated emails.   Is there a way I can modify the 'from' area to also include a name?  For example when a user receives an email with the below code the 'from' is admin@website.com.  I would like to give the email a name so that the 'from' would appear as "Website Admin <admin@website.com>".   Is that possible?

   $mailErrors = sendMessage(array(
      'to'       =>  $_REQUEST['email'],
      'from'     =>  'admin@website.com',
      'subject'  =>  $_REQUEST['reply_subject'],
      'html'     =>  $message,
    ));

Any help would be greatly appreciated.

Dan

Dan Perez

By Dave - September 18, 2017

Thanks for posting the solution! 

Dave Edis - Senior Developer
interactivetools.com