We help IT Professionals succeed at work.
Get Started

What have I got to do to get this email script to work?

Bruce Gust
Bruce Gust asked
Last Modified: 2015-03-02
When I use the following script, I get the email but there's two things that need to change:

First off, I need a correct "From." Right now, it just says "Apache."

The other thing I want to do is incorporate some HTML within the body of the email itself. I know this requires some headers and I've played with some stuff, but I just need a mind greater than my own to show me how to change what I have so it accommodates the "from" as well as some HTML content.


Here's my script:

$admin_email = "bruce.gust@verizonwireless.com, bruce@brucegust.com";
$email = "bruce@brucegust.com";
$subject = "bring it!";
 $comment = "I'm hoping that this works!";
  //send email
  mail($admin_email, $headers, $subject, $comment, "From:" . $email);

Open in new window

Watch Question
Fixer of Problems
Most Valuable Expert 2014
This problem has been solved!
Unlock 2 Answers and 2 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE