Current location: Hot Scripts Forums » Programming Languages » PHP » PHPMailer help!


PHPMailer help!

Reply
  #1 (permalink)  
Old 09-19-06, 09:46 AM
sejohnson sejohnson is offline
New Member
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
PHPMailer help!

Well I'm pretty new to PHP and this is my first time ever trying to send emails.
I can send an email just fine but I want it to send when the send button is pressed and I cant figure out how to do that. All the info is also going into a database when the button is pressed. Also I was trying to figure out how to make the recipients address dynamic. I have an ENUM full of addresses in the database and another ENUM with the names that relate to the address, they only select the name of the person on the page and do not see the address.

Thanks for any help!

EDIT: ok i figured out how to send it on a button press... but I can't figure out how to get the correct email address out of the database. It will pull the first record out everytime.

PHP Code:

<?php

//Send Email
require 'phpmailer/class.phpmailer.php';
$mail = new phpmailer();
$mail->From $_POST['Sender'];
$mail->Subject $_POST['Subject'];
$body $_POST['Message'];
$mail->Body $body;
$mail->AddAddress('sjohnson@envision-ink.com');
if(!
$mail->Send()){
  echo 
'Mail sending failed';
} else {
echo 
'Mail sent successfully';
}
?>

Last edited by sejohnson; 09-19-06 at 10:13 AM.
Reply With Quote
  #2 (permalink)  
Old 09-19-06, 11:00 AM
sejohnson sejohnson is offline
New Member
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
uhg

Hmm I got rid of two ENUM fields in my database and replaced them with VARCHARs thinking it would be easier. But i still can't figure out how to get the RecipientsEmail that is in the same row in the database as the contactID that I already possess. Any help would be appreciated.

Last edited by sejohnson; 09-19-06 at 11:42 AM.
Reply With Quote
Reply

Bookmarks


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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending email to multiple receipients in phpmailer EvilDeveloper PHP 1 02-24-06 08:42 AM
Help please civrob PHP 1 06-03-04 03:54 AM
help wanted in PhpMailer parameswaryn PHP 0 05-06-04 09:30 PM


All times are GMT -5. The time now is 07:28 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.