[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

Why is this email pipe resulting in a bounce back?

Hi,
So I have a shared hosting account. My host uses cpanel. I believe I have the address to my script is correct (99% sure). Everytime i try to send to this email address I get a bounce back. I am not quite sure why.

Do I need a hashbang with all my included files also?

Finally how do i get the email address of the sender. I am not quite sure...
#!/usr/bin/php
<?php
    require_once('classes/class.formatmail.php');
	$emails = array(
		array('name'=>'XXX','email'=>'XXX')
	);
	
	$fd = fopen("php://stdin", "r"); 
 
	$contents = "";
	while (!feof($fd)) {
  		$contents .= fread($fd, 8192);
	}
 
	fclose($fd);
 
	$GLOBALS['CONTENT']=$contents;
 
	foreach ($emails as $email){
			
			$GLOBALS['NAME']=$email['name'];
			$GLOBALS['EMAIL']=$email['email'];
			
			$FM=new FormatMail('templates/email.htm');
			
			$FM->Mailer->FromName='xxx';
			$FM->Mailer->From='xxx';
			$FM->Mailer->Subject='xxx';
			$FM->Mailer->AddAddress($email,$name);
		
			if ($FM->Send())
			echo 'Mail sent successfully to: '.$name.' with email: '.$email;
			
			//Or echo the result
			//echo $FM->Message;
		}
	}
?>

Open in new window

0
soparrissays
Asked:
soparrissays
  • 5
  • 4
1 Solution
 
Ray PaseurCommented:
This appears to be a data dependent problem, right?  If that is the case, we need to see the actual data, not a string of XXX.  Also where did you get the class you're using?  Does it have a manual?  Thanks, ~Ray
0
 
soparrissaysAuthor Commented:
I am using php mailer. Below is the real source. I didn't want google to find real email addresses and such.

Manual could be found at: http://phpmailer.codeworxtech.com/

I have gotten that script to work for a few email campaigns.

Thanks
#!/usr/bin/php
<?php
    require_once('classes/class.formatmail.php');
	
	$fd = fopen("php://stdin", "r"); 
 
	$contents = "";
	while (!feof($fd)) {
  		$contents .= fread($fd, 8192);
	}
 
	fclose($fd);
	
	$GLOBALS['CONTENT']=$contents;
	
	foreach ($emails as $email){
			
			$GLOBALS['NAME']=$email['name'];
			$GLOBALS['EMAIL']=$email['email'];
			
			$FM=new FormatMail('templates/email.htm');
			
			$FM->Mailer->FromName='Blue Sky Research';
			$FM->Mailer->From='bluesky@parrisstudios.com';
			$FM->Mailer->Subject='Blue Sky Research: ';
			$FM->Mailer->AddAddress($email,$name);
		
			if ($FM->Send())
			echo 'Mail sent successfully to: '.$name.' with email: '.$email;
			
			//Or echo the result
			//echo $FM->Message;
		}
	}
?>

Open in new window

0
 
soparrissaysAuthor Commented:
Opps i forgot this line also!
$emails = array(
		array('name'=>'Parris Khachi','email'=>'president@parrisstudios.com')
	);

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
soparrissaysAuthor Commented:
Furthermore, I believe it was actually extended upon using this:
http://www.phpclasses.org/browse/package/4244.html
0
 
Ray PaseurCommented:
Sorry -- I'm having server issues here, so my last comment was lost.  Have you considered using a service like Constant Contact?
0
 
soparrissaysAuthor Commented:
That may be an easy way out of this haha. The script seemed like it should work, and it does for the most part. It just doesn't like the whole pipping thing. I suppose?

I'll look into it.
0
 
Ray PaseurCommented:
Honestly, I've wrestled with sending email for years and it is always a moving target.  There are too many external factors - blacklists, ISP turf wars, incompetent server admins, surprise (and inaccurate) spam filters, MX snafus, etc.  The list is endless.  In the end I have spent thousands of hours on the subject and the problem has NEVER been the email message or the headers.  And that's why I am leaning toward Constant Contact.  Our church sends 1900 messages a week.  At those levels, it's so cheap to use that it is almost free.  And they have a small army of people who spend their professional lives making sure email goes through.  It looks like a good deal to me!
0
 
soparrissaysAuthor Commented:
Definitely. This is true! Thanks for the advice.
0
 
Ray PaseurCommented:
And thanks for the points.  I'm all about getting results, and I wish you the best with this project, ~Ray
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now