HELP, PLEASE !!!!!

jamz

No avatar

2006-02-23 07:33

hello all, could you help me to solve the problems, they are :

1. when i send email to administrator using contact page, the error message is " mail sending error"

2. when i try to order, the notification comes to administrator NOT, also to the customer.

Thanks in advance.

Regards,
Jasmine

wizzud

No avatar

2006-02-23 17:25

What version of Quick.Cart?
What plugins (if any) do you have installed?
What operating system are you running on? Windows/IIS? or Linux/Apache?
What version of PHP is your web server running?

If you are running without the relevant plugin(s) then Quick.Cart will only send order notification to Admin - it does not send order notification to customers.

jamz

No avatar

2006-02-24 03:31

Thanks for reply,

1. i use the latest QC and have intalled at www.gcf.co.id/qc (for the temporary).

2. It runs on Linux/apache

3. PHP 4.4.1 (is taht problem ?, because i can not change the php version due to i'm not the owner of the server, i just rent space)

Regards,
Jasminine

wizzud

No avatar

2006-02-24 12:12

Ok, I'm stumped now.
What you've got is the mail function working ok for orders but not for the contact form, and I can't see what the difference is (except for an uppercase 'FROM' for orders compared to 'From' for contact,which shouldn't make any difference whatsoever!).

jamz

No avatar

2006-02-25 03:42

how do you know that mail fuction ok for the order ? i still got notification of new order in my mailbox.

Yesterday i contact webmaster and ask me to use the code, but i do not know how to use it since i'm new at php.


define("MY_SITE","YourDomain.com");
define("MAIL_SERVER","mail.YourDomain.com");
define("MAIL_BOX","postmaster@YourDomain.com");
define("MAIL_PSW","password");

Of course, You should replace the above values with the real ones - e.g. MY_SITE is the name that will appear in the from field, MAIL_BOX is the valid email address from Your domain and MAIL_PSW is the password for this mailbox.

This is the rest of the code that actually sends the mail:

//---------------------------------------------------------------------------- ------------------------
function server_parse($socket, $response) {
//---------------------------------------------------------------------------- ------------------------
while(substr($server_response,3,1)!=' ') {
if(!($server_response=fgets($socket,256))) die("Couldn't get mail server response codes");
}

if(!(substr($server_response,0,3)==$response)) die("Ran into problems sending Mail. Response: $server_response");
}


//---------------------------------------------------------------------------- ------------------------
function smtpmail($mail_to, $subject, $message, $headers = "") {
//---------------------------------------------------------------------------- ------------------------
$tz = date("Z");
$tzs = ($tz < 0) ? "-" : "+";
$tz = abs($tz);
$tz = ($tz/3600)*100 + ($tz%3600)/60;
$datum = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz);

$message = preg_replace("/(?<!\r)\n/si", "\r\n", $message);

$headers = chop($headers);
$headers .= "From: ".MY_SITE." <".MAIL_BOX.">\r\n";
$headers .= "Reply-To: ".MAIL_BOX."\r\n";
$headers .= "Date: ".$datum;

if($mail_to == "") die("No email address specified");
if(trim($subject) == "") die("No email Subject specified");
if(trim($message) == "") die("Email message was blank");

$mail_to_array = explode(",", $mail_to);

if( !$socket = fsockopen(MAIL_SERVER, 25, $errno, $errstr, 20) ) {
die("Could not connect to smtp host : $errno : $errstr");
}

server_parse($socket, "220");

fputs($socket, "EHLO ".MAIL_SERVER."\r\n");
server_parse($socket, "250");

fputs($socket, "AUTH LOGIN\r\n");
server_parse($socket, "334");
fputs($socket, base64_encode(MAIL_BOX) . "\r\n");
server_parse($socket, "334");
fputs($socket, base64_encode(MAIL_PSW) . "\r\n");
server_parse($socket, "235");

fputs($socket, "MAIL FROM: ".MY_SITE." <" . MAIL_BOX . ">\r\n");
server_parse($socket, "250");

$to_header = "To: ";
@reset( $mail_to_array );
while( list( , $mail_to_address ) = each( $mail_to_array )) {
$mail_to_address = trim($mail_to_address);
if ( preg_match('/[^ ]+\@[^ ]+/', $mail_to_address) ) {
fputs( $socket, "RCPT TO: <$mail_to_address>\r\n" );
server_parse( $socket, "250" );
}
$to_header .= ( ( $mail_to_address != '' ) ? ', ' : '' ) . "<$mail_to_address>";
}

fputs($socket, "DATA\r\n");
server_parse($socket, "354");
fputs($socket, "Subject: $subject\r\n");
fputs($socket, "$to_header\r\n");
fputs($socket, "$headers\r\n\r\n");
fputs($socket, "$message\r\n");
fputs($socket, ".\r\n");
server_parse($socket, "250");

fputs($socket, "QUIT\r\n");
fclose($socket);

return TRUE;
}

Back to top
about us | contact