[Webmakers] Help with PHP mail function

Patrick Marr pmarr at treasury.ri.gov
Thu May 3 15:04:37 EDT 2012


We do, and our code looks like this:

 

               $headers  = 'MIME-Version: 1.0' . "\r\n";
               $headers .= 'Content-type: text/html; charset=iso-8859-1'
. "\r\n";
               $headers .= 'From: TREASURY WEBSITE
<no-reply at treasury.ri.gov>' . "\r\n";
               mail($to, $subject, $message, $headers);

--------------------------------------------

Patrick Marr 401.462.7664 o | 401.559.3727 m

 

From: webmakers-bounces at listserve.ri.gov
[mailto:webmakers-bounces at listserve.ri.gov] On Behalf Of Steve
Beauchemin
Sent: Wednesday, May 02, 2012 10:49 PM
To: webmakers at listserve.ri.gov
Cc: Mike Aubin; Bill Del Prete (DOA); Matthew Lang (DOT); Andrew Reidl
(DOA)
Subject: [Webmakers] Help with PHP mail function

 

Hello everyone--

 

I've been away from PHP for quite awhile and can use some help please.

 

I have PHP script that is no longer sending email since the Enterprise
Server Group made a change to the DNS settings. Does anyone else use the
PHP MAIL() function to send email from a form?

 

I need to change set the from but can't get it to work... Bill Del Prete
suggested the DNS name (mailtran.admin.ri.gov) but that's not working
for me...

 

Here's what I had that worked prior to the change:

 

foreach ($addresses as $to){
mail($to,$subject,$message,$headers,"-f from");

 

I tried to add it to the headers as so but still no joy (the handler
page does give me any errors, so the emails seem to be getting there,
the server must not be sending them because I don't have the from set
correctly):

 

 

$headers = "Content-Type: text; charset=ISO-8859-1\r\n";

$hearers .= "cc: <<list of emails>>;

$headers .= "from:mailtran.admin.ri.gov";   << ADDED THIS LINE TO SCRIPT
AND REMOVED -f from

 

 

 

Thanks, Steve

 

 

 

 

 

 

___________________________________________________

Stephen M. Beauchemin
State of Rhode Island
Division of Information Technology - DMV IT Manager

Aime Forand Bldg. Room 230A
600 New London Ave

Cranston, RI 02920
stephen.beauchemin at doit.ri.gov 
Phone:(401)462-4704
Cell: (401)641-5956
Fax:(401)462-5790

This e mail and any attachments thereto contain confidential and/or
privileged information from the State of RI Department of
Administration, Division of Information Technology.  It is intended only
for the use of the named addressee(s).  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or use of the contents of this e mailed information is
strictly prohibited and unauthorized.  If you receive this e mail in
error, please immediately notify the sender by e mail or telephone and
permanently delete all copies of this e mail and any attachments.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserve.ri.gov/pipermail/webmakers/attachments/20120503/bfd676f2/attachment.html 


More information about the Webmakers mailing list