This topic is locked

Send email with new data

6/2/2008 5:05:39 PM
PHPRunner General questions
S
shoppy author

Hi all,

I used the 'Send email with new data' in Events.

Just want to send an email when I have done an edit on a record.
After the edit I want to have it send an email with the content of two fields.

These are the fields 'Name' and the field 'Number'.

These fields are in the Table '_kandidaten'.

And I would like these two fields in the subject of the mail.
How do I do this?
regards,
John

S
shoppy author 6/4/2008

Hi all,

I used the 'Send email with new data' in Events.

Just want to send an email when I have done an edit on a record.
After the edit I want to have it send an email with the content of two fields.

These are the fields 'Name' and the field 'Number'.

These fields are in the Table '_kandidaten'.

And I would like these two fields in the subject of the mail.
How do I do this?
regards,
John


Is there nobody that can help me?

I realy need this thing to work.
John

J
Jane 6/4/2008

John,
if Name and Number fields are on the Edit page use this code in your event:

$subject=$values["Name"]." ".$values["Number"];

S
shoppy author 6/4/2008

Great Jane it works!
So how did I do it? Or better: How did Jane do it?

// ********** Send conformation email ************
ini_set('SMTP','post.demon.nl');
// variables

$to = "mail@mail.com";

$from = "Mail <mail@mail.com>";
$subject=$values["Name"]." ".$values["Number"];

$message=$values["Message"];
//Headers

$headers = "To: $to" . "\r\n";

$headers = "From: $from" . "\r\n";

$headres = "MIME-Version: 1.0" . "\r\n";

$headers = "Content-Type: text/html; charset=\"iso-8859-1" . "\r\n";
// Send the message
mail($to, $subject, $message, $headers);


Every time I edit a client it sends an email to the one responsable for this particulare client.
regards,
John

S
shoppy author 6/5/2008

Only one problem!!
It sends the mail fine but not using the $from adress but it uses an adres of my own that I did't use in PHPRunner.
strange .... anyone a solution?
Jane HELPPP
John

J
Jane 6/5/2008

John,
here is the correct code:

...

//Headers

$headers = "To: $to" . "\r\n";

$headers.= "From: $from" . "\r\n";

$headres.= "MIME-Version: 1.0" . "\r\n";

$headers.= "Content-Type: text/html; charset=\"iso-8859-1" . "\r\n";

...

S
shoppy author 6/5/2008

Great !!!
Jane, it works perfectly.
So when are we going to get married?

(I know a little chapel in Las Vegas)
Thanks a bundle,
John

powersitedesign 7/23/2008

John,

here is the correct code:


Just FYI, "$headres"is mispelled in the 3rd line down in case someone else needs to try this in the future...

It is working for me also by the way, here's what my event code looks like (...MANY THANKS TO JANE!!!!)

//********** Send email with new data ************
$email="me@email.com,".$values["resort_email"];

$message="";

$subject="Ownership Resorts Inquiry - ".$values["resort_name"];

$from="info@clientswebsite.com";
foreach($values as $field=>$value)

$message.= $field." : ".$value."\r\n";
//Headers

$headers = "To: $email" . "\r\n";

$headers.= "From: $from" . "\r\n";

$headers.= "MIME-Version: 1.0" . "\r\n";

$headers.= "Content-Type: text/html; charset=\"iso-8859-1" . "\r\n";



mail($email, $subject, $message, $headers);