Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

emails from catalog won't send


Guest

Recommended Posts

Hi,

 

I have my catalog up an running at Satellite Discs

 

I have a hosted server, for which I can't edit the php.ini, and which uses SMTP) so I've also added the SMTP contribution.

 

My problem is that, while I can send emails from Admin, I can't from the catalog.

 

I noticed that, when I uncomment the body line like so...

 

// The body of the email
//   $send_params['body'] = "$this->output";

 

...in the edited \store\includes\classes\email.php, I DO GET THE EMAIL, but it (of course) has no body!!!!!

 

So what would stop the catalog sending any emails without a body?

Link to comment
Share on other sites

Crazy update to this...

 

I took a look at the password_forgotten.php, and noticed that I change...

 

tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

to be...

 

      tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, $new_password, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

... basically "sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password)" became "$new_password"...and it worked. So the problem either has something to do with the SMTP class not liking the sprintf function or it not liking this instance where sprintf is being used with the rather complex EMAIL_PASSWORD_REMINDER_BODY as defined in the default language file.

 

I'm pretty sure is a combo of both, because I changed the language file to be somehting really simple, ie...

 

define('EMAIL_PASSWORD_REMINDER_BODY', 'Your new password to the Satellite Discs online store is: ');

 

...and then using the default password_forgotten.php the resultant email came out like...

 

Your new password to the Satellite Discs online store is:

 

so, in summary,

 

I can get a password if I don't use the sprintf() function, but I don't get any nice text in the email. If I do use the sprintf() function, I can only get it to add text from the language file if I simplify it, but then I can get the new password appended.

 

Can someone come up with a solution or workaround so that sprintf() can work with the SMTP contrib?

Link to comment
Share on other sites

OK, looks like there's not much interest in this. :(

 

I do have one question though, since I can't view my SMTP server's error log, how can I view the email formatting that oscommerce creates? Can I get the mail functions to send the email to a text file, so that I can examine it? If so, can someone give me some pointers as to how to do that?

 

Marty

Satellite Discs

Link to comment
Share on other sites

Sorted...

.

http://www.oscommerce.com/forums/index.php?showtopic=90360

 

...the solution in my case was to forget about the SMTP "contribution" and use the mail::factory php function. It really was a piece of cake, and now I can leave my password_forgotten.php the way it was and everything is fine and dandy.

 

One thing though - you can't use the "Send extra order emails to" fucntion in Admin, it will cause problems when the user makes the order. It's easier to edit the SMTP to...

 

$headers["To"] = array("$to_addr","[email protected]");

Link to comment
Share on other sites

One thing though - you can't use the "Send extra order emails to" fucntion in Admin, it will cause problems when  the user makes the order.  It's easier to edit the SMTP to...

 

$headers["To"] = array("$to_addr","[email protected]");

 

actually, I did have a problem with the above, and I ended up doing something like this...

 

 

     if (EMAIL_TRANSPORT == 'smtp') {

   include_once("Mail.php");

   $headers["From"]    = $from;
   $headers["To"]      = $to_addr;
   $headers["Subject"] = $subject;
   $headers["Bcc"] = "[email protected]";
   $params["host"] = "yourdomain.com";
   $params["port"] = "25";
   $params["auth"] = false;
   $params["username"] = "user";
   $params["password"] = "password";

   // Create the mail object using the Mail::factory method
   $mail_object =& Mail::factory("smtp", $params);
   return $mail_object->send("$to_addr, [email protected]", $headers, $this->output);

     }

   }

 

I don't even think that the...

    $headers["Bcc"] = "[email protected]";

...line was necessary, but I put it in anyway. :thumbsup:

Link to comment
Share on other sites

  • 1 month later...

Hi Guys,

 

I was just wondering about using this email method...

 

I am running the SMTP contribution which is fine and I have actually added our email

address as a cc in the SMTP contribution so we can get the extra order emails etc...

 

My problem is that I also have a couple of other contribs that are batch orientated and I there for cannot send out emails in batches as I get an error about redeclaring the SMTP class which frustrates me.

 

This is similar to the problem I trying to send a newsletter via admin when you are running the SMTP contrib.

 

So I am wondering if using this method you have spoken of will work if multiple emails

are sent out at the same time.

 

Any Thoughts?

 

 

Cheers!!

Link to comment
Share on other sites

  • 3 months later...

Hi everyone,

 

I tried to use this the mail::factory php function, but my sytem told me that " mail.php " file cannot be found, can anyone rush tell me where I can get this file for completion of the mail installation.

 

Many thank.

Link to comment
Share on other sites

actually, I did have a problem with the above, and I ended up doing something like this...

 ? ? if (EMAIL_TRANSPORT == 'smtp') {

? [COLOR=red] include_once("Mail.php");[/COLOR]

? ?$headers["From"] ? ?= $from;
? ?$headers["To"] ? ? ?= $to_addr;
? ?$headers["Subject"] = $subject;
? ?$headers["Bcc"] = "[email protected]";
? ?$params["host"] = "yourdomain.com";
? ?$params["port"] = "25";
? ?$params["auth"] = false;
? ?$params["username"] = "user";
? ?$params["password"] = "password";

? ?// Create the mail object using the Mail::factory method
? ?$mail_object =& Mail::factory("smtp", $params);
? ?return $mail_object->send("$to_addr, [email protected]", $headers, $this->output);

? ? ?}

? ?}

 

I don't even think that the...

 ? ?$headers["Bcc"] = "[email protected]";

...line was necessary, but I put it in anyway.  :thumbsup:

 

Where I can find the mail.php file from above marked red?

Link to comment
Share on other sites

  • 4 weeks later...

i done it but nothing happens

 

even the contact_us.php don't get sent now!

 

i got to do this because the damn email crap is killing me.

 

Any advice anyone please? [email protected] goes through but nothing for customers goes through... no order emails/updates/newsletter/confirmation etc

 

thanks

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

General advice only I'm afraid. If you're on a Windows server then set the mail settings in osC admin panel to SMTP, but if you're on an Apache web server (Unix/Linux) then set it to Sendmail.

 

Set 'Use MIME HTML' to false, and set 'Verify e-mail addresses through dns' to false also.

 

Vger

Link to comment
Share on other sites

  • 3 months later...

http://www.oscommerce.com/community/contri...all/search,smtp

 

After applying the "SMTP through authenticated SMTP server" contribution above, my "Contact Us" fuction stopped working. :( All inquiries coming to us through this "Contact Us" page would have the "From" email field replaced with our email address, instead of the customer email address.

 

Any help on this problem would be greatly appreciated.

 

Thanks

-Tuan

Link to comment
Share on other sites

actually, I did have a problem with the above, and I ended up doing something like this...

	 if (EMAIL_TRANSPORT == 'smtp') {

include_once("Mail.php");

$headers["From"]	= $from;
$headers["To"]	  = $to_addr;
$headers["Subject"] = $subject;
$headers["Bcc"] = "[email protected]";
$params["host"] = "yourdomain.com";
$params["port"] = "25";
$params["auth"] = false;
$params["username"] = "user";
$params["password"] = "password";

// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);
return $mail_object->send("$to_addr, [email protected]", $headers, $this->output);

  }

}

 

I don't even think that the...

	$headers["Bcc"] = "[email protected]";

...line was necessary, but I put it in anyway. :thumbsup:

 

 

I have been using this mail:factory solution for a while without any problem.

But now my hosting has re-installed the server and PHP ... and it's not working any more.

I am getting this error and they don't find the solution ... I appreciate any comment

 

Warning: send(Mail.php): failed to open stream: No such file or directory in /.../public_html/admin/includes/classes/email.php on line 457

 

Warning: send(): Failed opening 'Mail.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /.../public_html/admin/includes/classes/email.php on line 457

 

Fatal error: Undefined class name 'mail' in /.../public_html/admin/includes/classes/email.php on line 468

 

Thanks in advance

Fausto

Link to comment
Share on other sites

I have been using this mail:factory solution for a while without any problem.

But now my hosting has re-installed the server and PHP ... and it's not working any more.

I am getting this error and they don't find the solution ... I appreciate any comment

 

Warning: send(Mail.php): failed to open stream: No such file or directory in /.../public_html/admin/includes/classes/email.php on line 457

 

Warning: send(): Failed opening 'Mail.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /.../public_html/admin/includes/classes/email.php on line 457

 

Fatal error: Undefined class name 'mail' in /.../public_html/admin/includes/classes/email.php on line 468

 

Thanks in advance

Fausto

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Has anyone figured this mail::factory mod out?!? I have tried every smtp comunity mod listed.(only 3) I cant get any of them to work. I really need this to work by tomorrow. I have to get a customers store working. So please, if anyone has made this work please repackage the needed files with the correct edits done and upload them somewere. Thank You very very much Community! :D

Link to comment
Share on other sites

The mail.php file is from the PEAR package which can be found at http://pear.php.net. The documentation says it's already there for PHP v4.3 or higher which is what I'm running but I couldn't find the go-pear.bat file they refered to in the windows installation. If your running Linux, there are instructions in the manual.

 

I went through the entire installation though I'm not sure that I needed to because it still didn't work after the install. I copied the file mail.php from the top level pear directory into the include path as stated in the php.ini file. I'm running apache on a W2K machine so I put it in the apache\includes directory. I tested on a new account and also "tell a friend" and the emails went through fine.

 

If you want to try and just download the mail package and copy the top leve mail.php file, here is the link to that package. http://pear.php.net/package/Mail

 

Hope this helps.

Brian

Link to comment
Share on other sites

  • 1 year later...

OK i cant get this mod to work. I run a website on a linux host server, my customer orders and update emails are not being sent.

 

what I dont understand is I download the contribution and install it as required but still no joy.

 

where is the php.ini file? i dont have one.

 

do i need to download some other 3rd party software ie pear and install that first?

 

Also unclear on how to setup the details, my email account is held on the server with [email protected] as the email address.

 

the only emial files i have in my oscommerce are the 2 files in the classes folders.

Link to comment
Share on other sites

OK i cant get this mod to work. I run a website on a linux host server, my customer orders and update emails are not being sent.

 

what I dont understand is I download the contribution and install it as required but still no joy.

 

where is the php.ini file? i dont have one.

 

do i need to download some other 3rd party software ie pear and install that first?

 

Also unclear on how to setup the details, my email account is held on the server with [email protected] as the email address.

 

the only emial files i have in my oscommerce are the 2 files in the classes folders.

You only need to set up your store in admin and set it to use sendmail.

Link to comment
Share on other sites

  • 1 month later...

Anyone realize this contribution do not work with shipping_estimator.php?

 

it's weird i got shipping_estimator.php working fine. After install SMTP contribution, all user before log on can use shipping_estimator, once somebody sign up on the store then all shipping_estimator.php function is gone, and only show prices before tax in the box.......

Link to comment
Share on other sites

  • 1 year later...

Is sthere a way to make this work on any server? Regardless of the one you are presently on?

 

I notice that it presently doesn't work when I'm on my local development machine.

Link to comment
Share on other sites

  • 4 months later...

I have an oscommerce site that has been up for several months. Everything has been working without a hitch. Today, for some unknown reason I stopped receiving emails from my site. It is hosted on a dedicated server (apache) and the email server works fine. I have contacted the host to verify that the email server is working. I can receive email from other places but not my oscommerce store. If I place a test order, I get nothing if I send an email from send-mail, I get nothing. Not getting anything from the contact us page either. This all started suddenly without any editing to any files on my site. Can anyone please help?

 

Thanks, Rickey

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...