Jump to content


making an email form


6 replies to this topic

#1 blackandwhite2

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 15 May 2007 - 09:14 AM

Hi everyone.

ive trying to create an email form. i have already got it working and it sends to the email address.

im using an html form that conects to the php script.

however once the email is received it is all in the same font and i can seem to be able to put breaks inbetween the diffeent sections.

Could anyone please help me control the way the text in the received email is presented once being sent??

any help or guidance of someone who has done this before, or anyone who is trying to acheive the same thing would, i be very appreciated.

thank you
Mark

#2 Case

    Young Padawan

  • Members
  • Pip
  • 207 posts
  • Gender:Male
  • Location:Birmingham, UK

Posted 15 May 2007 - 11:49 AM

To put breaks in you need to use the new line character which is \n

E-mails are ASCII and so will always be one font. If you want to format them you need to put HTML code into them and inline styles but these will only be rendered if someone has a e-mail reader or program that parses html. Gmail, yahoo etc all do but others like demon.net do not and you will just see the plain code.

#3 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 16 May 2007 - 08:34 AM

well the formatting for the email has to be done on the php side before the email gets sent out. You have a few options:

- Option 1: HTML

Pros:
In the headers of the email set it up so the email is sent in html, then you can include images, use css to style and make the email look alot nicer to view and read.

Cons:
Not all mail clients can understand html emails, so if you send it to someone whos client doesn't understand html, they will just see a load of html, and unless they can understand it, they won't have a clue what the email is on about.

Any images linked too won't show by default, they need to click, show images, to see them.

- Option 2: Multipart

Pros:
Multipart emails solve the problems you get with the HTML emails. You can split the email into multiparts, one plain text bit, and one html bit, so the client can decide which bit to show.

Images can also be encoded into the email, that way they will always show. Email attachments are also done by multipart, again by encoding them into the email.

Cons:
For a beginner programmer it can be a bit confusing, but reading over some good sources and you should be ok with it.

Matt

#4 Jane Trimmer

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 20 May 2007 - 01:06 AM

View PostMr. Matt, on May 16 2007, 02:34 PM, said:

well the formatting for the email has to be done on the php side before the email gets sent out. You have a few options:

- Option 1: HTML

Pros:
In the headers of the email set it up so the email is sent in html, then you can include images, use css to style and make the email look alot nicer to view and read.

Cons:
Not all mail clients can understand html emails, so if you send it to someone whos client doesn't understand html, they will just see a load of html, and unless they can understand it, they won't have a clue what the email is on about.

Any images linked too won't show by default, they need to click, show images, to see them.

- Option 2: Multipart

Pros:
Multipart emails solve the problems you get with the HTML emails. You can split the email into multiparts, one plain text bit, and one html bit, so the client can decide which bit to show.

Images can also be encoded into the email, that way they will always show. Email attachments are also done by multipart, again by encoding them into the email.

Cons:
For a beginner programmer it can be a bit confusing, but reading over some good sources and you should be ok with it.

Matt


This is my first posting here.
Could you post some links to sources for tutorials of multipart forms? Thanks.

Jane

#5 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 24 May 2007 - 05:10 AM

http://www.sitepoint...anced-email-php

Best one I have found really, really good help!

#6 joe

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Location:stuck in the middle of cyber space

Posted 25 May 2007 - 11:18 PM

Thanx Mr. Matt for ur link...

joe

#7 Jane Trimmer

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 26 May 2007 - 01:39 AM

View PostMr. Matt, on May 24 2007, 11:10 AM, said:

http://www.sitepoint...anced-email-php

Best one I have found really, really good help!

Thank you very much Mr. Matt!

Jane





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users