Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic response

Status
Not open for further replies.

Poloboy

Technical User
Aug 26, 2002
58
US
Hi everyone,
I have a little issue with php settings and maybe script. I created a form for career application. When people submit their resume and It would mail to me and an automatic thankyou email send back to them. I got the automatic response to work but I cannot get it to email the application to me. I played with this for 2 days I can't figure out. I uploaded to WebHostingBuzz.com where my friends had his hosted, it works perfectly. So, i'm pretty sure it's my configuration. Can anyone please help. I'm running Apache2 with PHP4 on Windows 2000 Server. Here is the error I got from Apache2

SMTP server response: 550 A valid (syntax) address is required. in C:\Apache2\htdocs\Inetpub\new\sentresume.php on line 93

error 550 is usually user issue but I had that user.

php4.ini
[mail function]
; For Win32 only.
SMTP = mail.mydomain.com
smtp_port = 25

; For Win32 only.
sendmail_from = support@mydomain.com

If you need the script, I can post it too.

Thanks a lot!
 
is the smtp domain actually mail.mydomain.com (i.e. have you got the correct value in it?)
some ISP wont allow you to use foreign smtp servers you have to go thriught them. Freeserve/Wanadoo in the UK have such a policy
 
friend of mine had his hosted with Unix Server. The email server was also local, I host my own email server. Yes, i'm pretty sure i had the correct value because I was able to receive the confirmation but not application itself. Somehow it sent the confirmation to clients but not the application to my mailbox. I had the script, do you need me to post it?
 
i see, i think i read your first post incorrectly.
You want to send 2 emails, one arrvies the other does not ?.
or
I'm making an assumption that you might be trying to sent the same email to the two recipints - is this correct ?
Now ,the error you posted implies syntax on the address.
Can you post the script (or the relevant parts) it may be a stray ; or somethig.
Can you also tell us what the smtp server is you are using on windows
 
Yes, the application goes to my mailbox and client should receive confirmation email. I'm using Merak MailServer. Here is the script:'

<?php



// function for sending attachment with mail



function xmail

($email_address,

$email_cc,

$email_bcc,

$email_from,

$subject,

$msg,

$attach_filepath,

$want_attach)

{

$b = 0;

$mail_attached = "";

$boundary = "000XMAIL000";

if (count($attach_filepath)>0 && $want_attach) {

for ($a=0;$a<count($attach_filepath);$a++) {

if ($fp=fopen($attach_filepath[$a],"rb")) {

$file_name=basename($attach_filepath[$a]);

$content[$b]=fread($fp,filesize($attach_filepath[$a]));

$mail_attached.="--".$boundary."\n"

."Content-Type: image/jpeg; name=\"$file_name\"\n"

."Content-Transfer-Encoding: base64\n"

."Content-Disposition: inline; filename=\"$file_name\"\n\n"

.chunk_split(base64_encode($content[$b]))."\n";

$b++;

fclose($fp);

} else {

// echo "Anhang konnte nicht gesendet werden.";

}

}

$mail_attached .= "--".$boundary."\n";

$add_header ="MIME-Version: 1.0\n"

."Content-Type: multipart/mixed; boundary=\"$boundary\";

Message-ID: <".md5($email_from)."@cneinc.us>";

$mail_content="--".$boundary."\n"

."Content-Type: text/plain; charset=\"iso-8859-1\"\n"

."Content-Transfer-Encoding: 8bit\n\n"

.$msg."\n\n".$mail_attached;

return mail

($email_address,

$subject,

$mail_content,

"From: ".$email_from."\nCC: ".$email_cc."\nBCC: ".$email_bcc

."\nErrors-To: ".$email_from."\n".$add_header);

} else {

return mail

($email_address,

$subject,

$msg,

"From: ".$email_from."\nCC: ".$email_cc."\nBCC: ".$email_bcc

."\nErrors-To: ".$email_from);

}

}



// function ends


$to = "poloboy@mydomain.com";

$from = "resume@mydomain.com";

$subject = "New resume";

$cc = "";

$bcc = "";



// information

$email = $_POST['email'];

$name = $_POST['name'];

$address = $_POST['address'];

$city = $_POST['city'];

$state = $_POST['state'];

$zip = $_POST['zip'];

$phone = $_POST['phone'];

$coverletter = $_POST['letter'];



$message.= "*************** Online Resume ************\n\n";

$message.= "Following is the information regarding online job application\n";

$message.= "Name = ".$name."\n";

$message.= "Email = ".$email."\n";

$message.= "Address = ".$address."\n";

$message.= "City = ".$city."\n";

$message.= "State = ".$state."\n";

$message.= "Zip = ".$zip."\n";

$message.= "Home Phone = ".$phone."\n\n";

$message.= "Details Resume:\n" .$coverletter."\n";



$fp=fopen("resu/Online_resume.doc","w");

fwrite($fp,$message,strlen($message));

fclose($fp);

$attach_filepath = array();

$attach_filepath[0] = "resu/Online_resume.doc";

$want_attach = "true";



xmail($to,$cc,$bcc,$from,$subject,$message,$attach_filepath,$want_attach);


// confirmation email

$sub = "Thankyou for your application.";
$mes = "Thankyou for contacting New Atlantis Financial, Inc. We have received your email and are currently process your resume.\n";
$mes.= "A member of your recruiting staff will contact you once a suitable position becomes available.\n\n";
$mes.= "Thank you for the interest in New Atlantis Financial, Inc. We look forward to assisting you in your career advancement.\n";
$mes.= "New Atlantis Financial, Inc.\n";
$mes.= "$mes.= "PLEASE DO NOT REPLY TO THIS MESSAGE.\n";


$head = "From: resume@mydomain.com";
mail($email,$sub,$mes,$head);

Header ("Location: cthanks.php");

?>

<html>

<head>

<title>Online Application</title>

</head>

<body>


</body>

</html>
 
ok, so your callto mail() is ok the one to xmail() does not.
I cant see where you call mail() inside of xmail(), i wonder if that is the problem.
If I've missed somethign I wonder if it's worth getting phpmailer and using that instead.
 
I'm running MerakMailserver. Do I need to setup Xmail server for xmail to be functional?
 
you have a function called xmail() which I assumed you wrote. That function either needs to call the php inbuilt mail() or return a formatted string to supplt to mail() outside of xmail().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top