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

Discussion in 'PHP' started by Weirfire, Oct 6, 2004.

  1. #1
    How do I send an email with the PHP function mail so that when someone receives the mail it says the email is from instead of ?
    SEMrush
     
    Weirfire, Oct 6, 2004 IP
    SEMrush
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $mailto = 'you@yourdomain.co.uk';

    $mailsubject = 'Subject - Enquiry';

    $mailheaders .= "From: $NAMEFROMFORM <$EMAIL>\r\n";
    $mailheaders .= "Reply-To: $EMAILFROMFORM\r\n";
    $mailheaders .= "Return-Path: $EMAILFROMFROM\n";

    mail($mailto,$mailsubject,$mailtext,$mailheaders);
     
    T0PS3O, Oct 6, 2004 IP
    hurricane_sh and commandos like this.
  3. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,978
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Sweet.

    Works perfectly :)

    Thanks
     
    Weirfire, Oct 6, 2004 IP
  4. Lever

    Lever Deep Thought

    Messages:
    1,823
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    145
    #4
    OK, rather than start another thread on PHP mail forms, can I start part B of this one...? ( Sorry for the "threadjack" Weirfire ;) )

    I've got a client who is going to be using multiple forms on one page (up to about 4x of them) and numerous repeat forms throughout their site. I'm a newb to PHP so I searched for numerous PHP form methods - some were hugely complex, so I ended up finding a simple form. I been tryiong to get the damn thing to work for hours now, but to no avail :(

    Anyone know of a good, simple PHP form method that I can use, bearing in mind that I know so very little PHP...?

    Very many kind thanks in advance :)
     
    Lever, Oct 21, 2004 IP
  5. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,978
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #5
    No probs about the hijack. What exactly is it you want to do? Are you wanting to create a function that you can just call over and over again?

    If you post some code that you have already I'll see what I can do :)
     
    Weirfire, Oct 21, 2004 IP
  6. Lever

    Lever Deep Thought

    Messages:
    1,823
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    145
    #6
    Yo, Weirfire :) The code I used was from http://www.noviceform.com/ - I modified it with all the approriate paths etc in *all* the files. I went through it thoroughly again and again. When I tested the form I never received the mail. I went back through the code and files, tried it again. No mail. And so on.... *headscratch* :confused:

    Either there's an issue with my hosting and the client's hosting or with the code ??
     
    Lever, Oct 21, 2004 IP
  7. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Can't help you if:
    1. you don't explain what you are requesting for in more detail
    2. you don't post excerpts of the code you are working on

    noviceform dot com requires you to register - not many people will be willing to do that :)
     
    daboss, Oct 22, 2004 IP
  8. Lever

    Lever Deep Thought

    Messages:
    1,823
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    145
    #8
    Thanks daboss, I know what you mean. All I wanted was a very simple mail form that I could then use, and then modify. I have just found another one, tested it and it works straight away. The code looks similar to the ASP mailforms I've used in the past and looks like it will adapt to my needs.

    Thankyou :)
     
    Lever, Oct 22, 2004 IP
  9. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,978
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #9
    No probs Lever. Just give me a shout if you need any more help with PHP especially databases :) I'm still learning a lot of PHP stuff but I might still be able to help you out
     
    Weirfire, Oct 22, 2004 IP
  10. Lever

    Lever Deep Thought

    Messages:
    1,823
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    145
    #10
    Thanks Weirfire, I really appreciate that :D Once the dust settles after this project (8 months by time of expected launch) I'll be ready to do some other jobs (a database project included) and may just give you a shout to see what you can do.

    Thanks again :)
     
    Lever, Oct 22, 2004 IP
  11. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,978
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #11
    Please don't waste the moderators time by spamming your coded systems on years old threads.
     
    Weirfire, Dec 24, 2007 IP