Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-09-20
6
411 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XML extra information 8 29
PHP and MSSQL Arrays and Variables 3 23
Accessing specific element - DOM PHP HTML 8 34
AJAX Wordpress Not Reading Variable 2 27
These days socially coordinated efforts have turned into a critical requirement for enterprises.
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

809 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