R – Sending form without mail client


everubody! can you help me with my trouble? I'm trying to create form for filling resume. User should not use mail client to submit form. How can I realize this idea on javascript or PHP?

Best Solution

First: You need a server based script. Without any server interaction, no mail can be sent.

PHP has a mail() function and it works very well, if your server administrator enabled it. Very simple example:

// The message
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send
mail('caffeinated@example.com', 'My Subject', $message);

If mail() is disabled, you need to connect a SMTP server with correct credentials and then you can send mails via this connection. This function is implemented in the emailer module of phpBB2 e.g.

Good luck!