Computer Webmaster Gaming Console Graphics Forum

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.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

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.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 3:32 PM   #1
James
 
James's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default sending form data as email using SMTP server ???

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


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 07-01-2007, 3:32 PM   #2
Matt Montgomery
 
Matt Montgomery's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default sending form data as email using SMTP server ???

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



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:32 PM   #3
Matt Montgomery
 
Matt Montgomery's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default sending form data as email using SMTP server ???

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

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:32 PM   #4
Nikolai Chuvakhin
 
Nikolai Chuvakhin's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default sending form data as email using SMTP server ???

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
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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




All times are GMT +1. The time now is 2:09 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98