DeveloperSide.NET Forums
January 28, 2020, 03:29:08 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  DeveloperSide.NET / Web.Developer Server Suite Community Edition,
Public Support Forum
/ Re: Message fileld in PHP mail function
on: July 21, 2009, 10:45:52 PM
Hi!

Thank you for your reply.

I changed the code as follows:

$send = mail($MyEmail, $subject, 'TITLE: '.$greeting."\n"."\n".'NAME: '.$realname."\n"."\n".'EMAIL: '.$HisEmail."\n"."\n".'MESSAGE: '."\n"."\n".$message, $headers);

It works! :-)

Dr. T.



2  DeveloperSide.NET / Web.Developer Server Suite Community Edition,
Public Support Forum
/ Message fileld in PHP mail function
on: July 19, 2009, 04:46:39 PM
Hi!

As I posted before, I am slowly writing a PHP script for emailing the results of a form. The script is based on a variety of scripts found on the Web.

To do a preliminary test, I wrote the following PHP script:

<?php
$to = $_REQUEST['MyEmail'] ;
$subject = $_REQUEST['subject'] ;
$greeting = $_REQUEST['greeting'] ;
$realname = $_REQUEST['realname'] ;
$HisEmail = $_REQUEST['HisEmail'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $HisEmail";
$send = mail($to, $subject, $greeting, $headers);
?>

It works.

If, in the mail function, I replace $greeting with $realname it also works.

But, if I replace $greeting with $greeting\n$realname it doesn’t work. Why?

Thanks.

Dr. T.


3  DeveloperSide.NET / Web.Developer Server Suite Community Edition,
Public Support Forum
/ Email script
on: July 19, 2009, 08:53:51 AM
Hi!

I am writing a PHP script for emailing the results of a form. The script is based on a variety of scripts found on the Web.

The following section was found in one of the scripts. In this section, the script sends an email to the individual that filled the form.

$headers = "From: no_reply at ... ";
$subject = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at www  … ";

$send = mail($from, $subject, $autoreply, $headers);

The $from is a variable passed from the form (i.e., the recipient’s email address). The $subject and $autoreply are self-explanatory.

I assume the $headers is my email address, which is defined above.

My question is:  What is the word “From” that is included in the definition of $headers? Does that mean to place the value “no_reply at …“ in the From line like one would do in a regular email?

Thank you.

Dr. T.

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!