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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.