Jump to content

Send and email with html from php script.


denoteone

Recommended Posts

Hey everyone! This is my first post but I want to thank everyone ahead of time for any help.

 

I want to collect data from a form and then set the data into variables in my php script. but then I want to send a html email to a email address cotains some of the variables from the form

 

1. can i send an HTML formatted email?

 

2. can I use varibales in the HTML  from my php?

 

3. I am not sure if I get what $headers are?

 

I have  found a few tutorials but would like something that explains what it is doing not just give me the code.

 

I do have the the script working but it is the bask mail() function. nothing fancy

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/81251-send-and-email-with-html-from-php-script/
Share on other sites

Hey everyone! This is my first post but I want to thank everyone ahead of time for any help.

 

I want to collect data from a form and then set the data into variables in my php script. but then I want to send a html email to a email address cotains some of the variables from the form

 

1. can i send an HTML formatted email?

 

2. can I use varibales in the HTML  from my php?

 

3. I am not sure if I get what $headers are?

 

I have  found a few tutorials but would like something that explains what it is doing not just give me the code.

 

I do have the the script working but it is the bask mail() function. nothing fancy

Hi Denoteone,

 

To answer your questions:

1. Yes you can, you just need to make sure you have all the necessary information in your message and headers.

 

2. Most definitely.  It's done just the same way that you would do in any other php script.

 

3. $headers are extra information that can be passed along with the email.  They include Cc:, Bcc:, From: and Content-type, to name a few.

 

If you want to just use the php mail() function for sending HTML emails, it's easily doable.  Check out the information on the php.net website on how to accomplish this:

http://www.php.net/function.mail

 

 

Regards,

 

Brian

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.