1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Php and Email?

Discussion in 'PHP' started by kc3, May 8, 2005.

  1. #1
    I was wondering if you guys could show me a php tutorial about reading and sending email through php, I would also like it to explain email attachments.
    SEMrush
     
    kc3, May 8, 2005 IP
    SEMrush
  2. Mixposure

    Mixposure Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Mixposure, May 8, 2005 IP
  3. palespyder

    palespyder Psycho Ninja

    Messages:
    1,254
    Likes Received:
    98
    Best Answers:
    0
    Trophy Points:
    168
    #3
    This will get you started.

    http://us3.php.net/mail

    as far as reading email with PHP, no clue, never had to do it for anything.
     
    palespyder, May 9, 2005 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is about as easy as it gets :)
     
    exam, May 9, 2005 IP
  5. Mixposure

    Mixposure Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    He wants to send attachments.
     
    Mixposure, May 9, 2005 IP
  6. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Sorry my bad. Check out this class (You need to create an account with them to d/l )
     
    exam, May 9, 2005 IP
  7. Epica

    Epica Well-Known Member

    Messages:
    1,007
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    170
    #7
    I used this to get started. I've hacked mine up and rebuilt them so much I'm not sure whats my own and what is from this form, but I do remember it has tons of notes in the code so you can understand what segment accomplished which task, so customization is pretty simple.

    http://www.thesitewizard.com/wizards/feedbackform.shtml
     
    Epica, May 9, 2005 IP
  8. kc3

    kc3 Peon

    Messages:
    857
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks, I know how to send email but not with attachments. I also don't know how to read email. I'll check these out though. I'm still wanting more help if it's okay though.
     
    kc3, May 9, 2005 IP
  9. Trance-formation

    Trance-formation Peon

    Messages:
    598
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Trance-formation, May 10, 2005 IP
  10. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #10
    Dear Adam,

    This letter is in regard to your pending paternity suit...Please send us half of everything.

    Thanks
     
    noppid, May 10, 2005 IP
  11. Trance-formation

    Trance-formation Peon

    Messages:
    598
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Only half?? I can only assume you have only a passing aquaintance with the legal profession :)
     
    Trance-formation, May 10, 2005 IP
  12. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #12
    If you look at the code from what I posted, you can see that sending attachments is pretty easy. It amounts to adding some headers and reading in the file you want to attach, encode it as base64 and send it in a header. As far as reading mail, find out what all the possible headers are so you can deal with them. The headers all come at the beginning of the email, separated by an \r\n and the headers are separated from the email text by \r\n\r\n. One of the headers will tell you if the email is plain text or html etc. There are probably php mail parsing classes out there if you look for them.
     
    exam, May 10, 2005 IP