2 Replies - 1362 Views - Last Post: 21 February 2008 - 04:02 PM Rate Topic: -----

#1 bstonehill   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 113
  • Joined: 21-January 08

Help sending mail through php

Posted 21 February 2008 - 01:58 PM

I have a user submission form on our website that I need to e-mail the data to us. I had this setup before on our shared hosting account but had to host the actual form page on my machine here because of the shared hosting limitations (I'm using PHPMailer) and everything worked okay. I wanted to do it properly though so I have recently moved to Unix based VPS hosting and moved the form from my machine back to the server. Since I've moved the site though I cannot get it to generate the e-mails.

Is there anything I need to change in the php.ini file? If so I've opened it in PuTTY with "vi php.ini" but cannot get it to save any changes (nor let me exit other than closing PuTTY).

I've tried using IsQmail(), IsMail(), IsSendmail(), and IsSMTP(). I show the Qmail service is running in Plesk and the sendmail path is correct. I only get feedback with SMTP. The main error I keep getting is
"ERROR: RCPT not accepted from server: 550 sorry, no email box here by that name".

Can someone please help?

Here is the code:
  
  //Run Mailer  
  if(isset($_POST['submit'])){

	require("../phpclasses/class.phpmailer.php");

	$mail = new PHPMailer();
	
	$mail->IsQmail();
	$mail->Host = "mail.host.com";
	//$mail->Username = "[email protected]";
	//$mail->Password = "password";
	$mail->FROM = "[email protected]";
	$mail->AddAddress("[email protected]");
	$mail->Subject = "New Lead";
	$mail->Body = 'LEAD INFORMATION:
	
		Name: '.$_POST['firstName'].' '.$_POST['lastName'].'
		
		Company: '.$_POST['company'].'
		
		E-mail: '.$_POST['email'].'
		
		Phone: '.$_POST['phone'].'
	
		Existing System: '.$_POST['existing'].'
		
		Industry: '.$_POST['industry'].'
		
		Size: '.$_POST['size'].' sq.ft.
		
		Referred By: '.$_POST['referral'].'
		
		Comments: '.$_POST['comments'].'
		
		Best Time: '.$_POST['contactTime'];
	
	if(!$mail->Send()){
		echo "<script type='text/javascript'>
					alert('There was a problem submitting your request, please try again.');
					window.location = 'quote.php';
				</script>";
		
		//Mail Debug
		echo "Mailer Error: " . $mail->ErrorInfo;
		
		}
	else {
		echo "<script type='text/javascript'>
					alert('Thank you for your interest. A representative will be contacting you shortly.');
					window.location = 'http://www.sentrysurveillance.com';
				</script>";
		}
}



Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Help sending mail through php

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6876
  • View blog
  • Posts: 31,666
  • Joined: 10-May 07

Re: Help sending mail through php

Posted 21 February 2008 - 02:01 PM

View Postbstonehill, on 21 Feb, 2008 - 01:58 PM, said:

I only get feedback with SMTP. The main error I keep getting is
"ERROR: RCPT not accepted from server: 550 sorry, no email box here by that name".

All the code in the world can't force the user to exist. If you are getting a 550 response from the domain you are emailing to, then the code is working, they are responding that the user account does not exist.

It would be like taking your cell phone in for a repair because you dialed a friends number & the message is that the phone has been disconnected. Your phone made the request, but the service responded that the account no longer exists!
Was This Post Helpful? 0
  • +
  • -

#3 bstonehill   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 113
  • Joined: 21-January 08

Re: Help sending mail through php

Posted 21 February 2008 - 04:02 PM

View Postno2pencil, on 21 Feb, 2008 - 02:01 PM, said:

View Postbstonehill, on 21 Feb, 2008 - 01:58 PM, said:

I only get feedback with SMTP. The main error I keep getting is
"ERROR: RCPT not accepted from server: 550 sorry, no email box here by that name".

All the code in the world can't force the user to exist. If you are getting a 550 response from the domain you are emailing to, then the code is working, they are responding that the user account does not exist.

It would be like taking your cell phone in for a repair because you dialed a friends number & the message is that the phone has been disconnected. Your phone made the request, but the service responded that the account no longer exists!



Sorry, I had an emergency come up and was in a rush. Forgot to mention the email address is a known good address. I've been on the phone with the Hosting Company for two days trying to make sure everything in the server configuration was correct. Finally ended up figuring it out on my own. The e-mails were not going outside the local horde server and it would not resolve the correct mail server address. I had to lookup the numerical address and use that instead.

Thanks for the response!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1