Solved

php email sending and a From :Reply@MISSING_DOMAIN in the from tag

Posted on 2011-09-20
6
409 Views
Last Modified: 2012-05-12
I am sending out an email from a php page using the below code
and the result i am getting is below but what do i need to add to see my address instead of  Reply@MISSING_DOMAIN

 From :Reply@MISSING_DOMAIN
 To :garryihill@hotmail.com
 Subject :perp 22 has sent a reply to the poll
 Date :Tue, 20 Sep 2011 09:52:37

*****************************************************************************
$to = 'abc@googlemail.com ';


// subject

$subject = $_GET['companyname'];
// message

<html>
<head>
  <title> has sent a reply</title>
</head>
<body>
  <p>the following data has been added to the Data base subjest data</p>
 
</body>
</html>
';
$message .= 'Type of client: '.$_GET['typeclient']. "....\r\n";
$message .= 'Email: '.$_GET['txtemail']. "....\r\n";
$message .= 'Title: '.$title. ".....\r\n";

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From: Reply from ' . "\r\n";


// Mail it

mail($to, $subject, $message, $headers);
0
Comment
Question by:sydneyguy
  • 2
  • 2
  • 2
6 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 250 total points
ID: 36567859
where do you specify the reply address?

maybe you need:

// Additional headers
$headers .= 'From: person@example.com\r\n";
0
 
LVL 13

Assisted Solution

by:Hugh McCurdy
Hugh McCurdy earned 250 total points
ID: 36567925
mankowitz is very close, IMHO.  You have

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

That's where you need mankowitz's person@example.com  (except it should be a real e-mail address or at least no-reply@example.com).
0
 

Author Comment

by:sydneyguy
ID: 36568094
ok throwing back a

From:         Reply@, UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR.

line of code i am using is
$headers .= 'From: autoresp@abc.com' . "\r\n";
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 24

Expert Comment

by:mankowitz
ID: 36568116
I don't know if single quotes will escape correctly. Try these and see if any work

$headers .= "From: person@example.com\r\n";

$headers .= "From: person@example.com\r";

$headers .= "From: person@example.com\n";
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 36568195
Good point by mankowitz about the quotes.  I almost always use double quotes unless I have a good reason to use single quotes.  It is important to remember that the different quotes work differently in PHP (as mankowitz pointed out).
0
 

Author Closing Comment

by:sydneyguy
ID: 36568240
$headers .= 'From: autoresp@abc.com' . "\r\n";

this worked fine did not quite make sense because i had it workign before but i have to files a dev and real in diff dirs and was mod the dev file but was actually running the real file, change the right file and off she went thannks for the extra pair of eys
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The viewer will learn how to count occurrences of each item in an array.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question