![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| How can I take my form data and send it as an email using my SMTP server located @ my ISP using PHP ? my form has several fields: TO: this is a drop down list FROM: this is a drop down list SUBJECT: Free Type MESSAGE: Free Type CC: Check Box what I need to do is send the email TO the user selected, FROM the user selected, with the Subject and Message, If ticked CC then copied to the FROM user ! Any Ideas ? Thanks | |||
|
| Advertisements |
| | #2 | ||
| php.net - search for the email functions. "James" <James@NotHere.com> wrote in message news:cdimgvk193nentic1pbkr5qfrgjphcj9v7@4ax.com... > How can I take my form data and send it as an email using my SMTP server > located @ my ISP using PHP ? > > my form has several fields: > > TO: this is a drop down list > > FROM: this is a drop down list > > SUBJECT: Free Type > > MESSAGE: Free Type > > CC: Check Box > > what I need to do is send the email TO the user selected, FROM the user > selected, with the Subject and Message, If ticked CC then copied to the > FROM user ! > > Any Ideas ? > > Thanks > > | |||
|
| | #3 | ||
| although i don't think there's a CC function - just use the from: as an additional to: if it's checked, which should work. "Matt Montgomery" <NOSPAMmatt@NOSPAMchums.com> wrote in message news:sWHOa.79$nW5.126835@news.uswest.net... > php.net - search for the email functions. > > "James" <James@NotHere.com> wrote in message > news:cdimgvk193nentic1pbkr5qfrgjphcj9v7@4ax.com... > > How can I take my form data and send it as an email using my SMTP server > > located @ my ISP using PHP ? > > > > my form has several fields: > > > > TO: this is a drop down list > > > > FROM: this is a drop down list > > > > SUBJECT: Free Type > > > > MESSAGE: Free Type > > > > CC: Check Box > > > > what I need to do is send the email TO the user selected, FROM the user > > selected, with the Subject and Message, If ticked CC then copied to the > > FROM user ! > > > > Any Ideas ? > > > > Thanks > > > > > > | |||
|
| | #4 | ||
| James <James@NotHere.com> wrote in message news:<cdimgvk193nentic1pbkr5qfrgjphcj9v7@4ax.com>. .. > > How can I take my form data and send it as an email using my SMTP server > located @ my ISP using PHP ? > > my form has several fields: > > TO: this is a drop down list > FROM: this is a drop down list > SUBJECT: Free Type > MESSAGE: Free Type > CC: Check Box > > what I need to do is send the email TO the user selected, FROM the user > selected, with the Subject and Message, If ticked CC then copied to the > FROM user ! > > Any Ideas ? Actually, two. 1. If your ISP allows you to use the mail() function and has it properly configured: if ($_POST) { $to = $_POST['TO']; $from = $_POST['FROM']; $subject = $_POST['SUBJECT']; $message = $_POST['MESSAGE']; } else { die ('What the heck am I supposed to mail?'); } $headers = 'From: ' . $from . "\r\n"; if ($_POST['CC']) { $headers .= 'Cc: ' . $from . "\r\n"; } mail ($to, $subject, $message, $headers); 2. If not, get yourself a copy of phpMailer (http://phpmailer.sf.net/) and send your message via an external SMTP server: require ('class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = 'smtp.mysite.com'; $mail->SMTPAuth = true; // These three lines are necessary $mail->Username = 'me'; // only if your SMTP server $mail->Password = 'my_password'; // requires authentication $mail->From = $_POST['FROM']; if ($_POST['CC']) { $mail->AddCC($_POST['FROM']); } $mail->Subject = $_POST['SUBJECT']; $mail->IsHTML(false); $mail->Body = $_POST['MESSAGE']; $mail->Send(); Cheers, NC | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: data, email, form, sending, server, smtp, using |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pop3 and smtp | Neil Franklin | PHP | 1 | 07-01-2007 3:17 PM |
| Dumping Form data to file | Charles E. Pelkey | PHP | 3 | 07-01-2007 3:15 PM |
| sending SMS with PHP | BrI | PHP | 4 | 07-01-2007 3:13 PM |
| Please help - Cracking elevation data format in data file | Kevin Fishburne | Software Programming | 10 | 06-12-2007 11:31 PM |
| Featured Websites | ||||
|