Loans - Mortgages - Hong Kong Hotels - 0 Credit Cards - Loans

PDA

View Full Version : PHP Mail form


Weirfire
Oct 6th 2004, 4:00 am
How do I send an email with the PHP function mail so that when someone receives the mail it says the email is from staff@weirfire.co.uk instead of nobody@nacservers.com?

T0PS3O
Oct 6th 2004, 4:05 am
$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);

Weirfire
Oct 6th 2004, 4:29 am
Sweet.

Works perfectly :)

Thanks

Lever
Oct 21st 2004, 1:29 pm
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 :)

Weirfire
Oct 21st 2004, 1:33 pm
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 :)

Lever
Oct 21st 2004, 3:27 pm
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 ??

daboss
Oct 22nd 2004, 12:58 am
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 :)

Lever
Oct 22nd 2004, 1:10 am
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 :)

Weirfire
Oct 22nd 2004, 1:13 am
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

Lever
Oct 22nd 2004, 1:43 am
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 :)

Weirfire
Dec 24th 2007, 6:17 am
Please don't waste the moderators time by spamming your coded systems on years old threads.