Jump to content
Sign in to follow this  
Jack_mcs

AutoEmailer

Recommended Posts

Jack,

 

it is the mail class. Replacing the code works just fine. You need to change this:

 $tmessage->Send();

to this:

// $tmessage->Send();
	 $headers = 'MIME-Version: 1.0' . "\r\n";
	 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	  mail($Recipiant, $Subject, $message, $headers);

 

So why not use the class already available in oscommerce? Would it not work?

 

Alex


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

emails just arrived!

But always in text format, like this:

 

Content-type: text/html; charset=iso-8859-1 X-Antivirus: AVG for E-mail 7.1.371 [267.14.16/225]



	 <html>
	  <head>
	   <title>Happy birthday - Buon Compleanno</title>
	  </head>
	  <body>
<!-- start message //-->
Auguri!
<!-- stop message //-->
	 </body>
	 </html>


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

TRy changing this:

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 

to this:

$headers .= 'Content-Type: text/html; charset="utf-8"' . "\r\n";

 

To see if there is any difference.

 

Alex


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

same problem:

Content-Type: text/html; charset="utf-8" X-Antivirus: AVG for E-mail 7.1.371 [267.14.16/225]



	 <html>
	  <head>
	   <title>Happy birthday - Buon Compleanno</title>
	  </head>
	  <body>
<!-- start message //-->
Auguri!
<!-- stop message //-->
	 </body>
	 </html>

 

:(


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Jack,

 

it is the mail class. Replacing the code works just fine. You need to change this:

 $tmessage->Send();

to this:

// $tmessage->Send();
	 $headers = 'MIME-Version: 1.0' . "\r\n";
	 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	  mail($Recipiant, $Subject, $message, $headers);

 

So why not use the class already available in oscommerce? Would it not work?

 

Alex

You can't use the code from oscommerce with including a bunch of files. There is nothing wrong with that but I was trying to keep the code size down. The functions in oscommerce are just wrappers of course so the basic php code could be taken from it, as I did in this case. But that class already had all of the work done do I opted for it. No one has reported a problem until now. I might need to start over with that part of it.

 

Jack

Share this post


Link to post
Share on other sites

Ok I uderstand. It's never nice to be in a position to report a problem and as you said it looks like it's all server specific.

 

It seems that there might be one more problem with auto_announce now. It those Happy Birthday emails, there is no $Sender as specified in auto_emailer.php. After this change:

// $tmessage->Send();
	 $headers = 'MIME-Version: 1.0' . "\r\n";
	 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	  mail($Recipiant, $Subject, $message, $headers);

the sender is my hosting server now:

user@secure2.apollohosting.com

 

Including $Sender in mail() doesn't work.

 

Thank you,

 

Alex


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

The way that code works is to include the all of the parts of the header in the $header variable. So you could use

$headers .= 'To: First person@test.com, Second person@ttest.com>' . "\r\n";
$headers .= 'From: me@test.com>' . "\r\n";
$headers .= 'Cc: you@test.com' . "\r\n";
$headers .= 'Bcc: all@test.com' . "\r\n";

Of course, the script isn't set up to include the customers that way. You could add a line

$headers .= $Sender;

which should work, I think.

 

Jack

Share this post


Link to post
Share on other sites

Thank you, with the following change in auto_announce.php, it seems to work now:

// $tmessage->Send();
	 $headers = 'MIME-Version: 1.0' . "\r\n";
	 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	 $headers .= 'From: me@test.com' . "\r\n";
	  mail($Recipiant, $Subject, $message, $headers);

 

I have not used this line: $headers .= $Sender; anywhere, is it needed?

 

Do you have an idea how to include description of new products in sent emails in one language only? We use four different languages in our shop therefore the descriptions are included 4 times in emails. I've been trying to use your advise from post #44 and after inserting language_id = ' . 1 . ' in mysql_query I received emails with no products nor descriptions in them. I have also tried to change it to all these variations:

pd.language_id = ' . 1 . '
p.language_id = ' . 1 . '
pd.language_id = '" . (int)$languages_id . "'

but nothing works. Any idea why?

 

With regards to thousands of test messages being received, When I insert the following in auto_emailer/auto_newproducts.php,

$tmessage->Send();
break;

I receive no email. When I delete it, I receive one for each customer, which is annoying and almost impossible to test.

 

Alex


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

I plan to add an option for languages in the next release (whenever that is). I don't know why that fix isn't working and I can't work on it right now.

 

You should receive one email with that break in there. I can't say what that isn't working. You could try this approach, which may work better for you. Add

$ctr = 0;

before the line that starts with

while ($customer = mysql...

After

	 $tmessage->Send();

add the following

if ($ctr > 5) 
break;
$ctr++;

With that, you should receive 5 emails before it stops.

 

Jack

Share this post


Link to post
Share on other sites

Hello,

I am interested in this mod to get customer and order reports emailed to me. My question is: What is the necessity/purpose of the FCKEditor?

Thank you

-Deb

Share this post


Link to post
Share on other sites

It is used in a few of the modules to allow you to create a better looking message to send. For the modules you want to use, it is not needed. You should be able to still run it but the ones that require it won't work.

 

Jack

Share this post


Link to post
Share on other sites

Does anyone knows what can be wrong? I get this every time I try to update the auto emailer settings:

 

 

Warning: fopen(auto_emailer/auto_emailer.php): failed to open stream: Permission denied in /home/webadmin/public_html/oscommerce/admin/includes/functions/auto_emailer.php on line 120

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/webadmin/public_html/oscommerce/admin/includes/functions/auto_emailer.php on line 130

Cannot write to file (auto_emailer/auto_emailer.php)

 

And when I try to send me a test:

 

Fatal error: Maximum execution time of 30 seconds exceeded in /home/webadmin/public_html/oscommerce/admin/auto_emailer_announce.php on line 103

 

Please help

Share this post


Link to post
Share on other sites

For the write problem, make sure the permissions on the files in the auto_emailer directory are 755 (some hosts require 777).

 

For the timeout problem, try running the script from the browser. If it runs, then there is a problem with your cron setup. If it fails, take a look at the posts in the last few pages. There are some quick test scripts you could use to verify the basic code is working.

 

Jack

Share this post


Link to post
Share on other sites

I'm receiving the CRON e-mail but the content is: "No Database Selected".

 

What would cause this message? I can usually get these contributions to work but am not a PHP coder and can't troubleshoot the code very well. Any advice is GREATLY appreciated...

 

Thanks :blink:

Share this post


Link to post
Share on other sites

If your shop is not in the root, you will need to change this line in auto_emailer.php:

include('../includes/configure.php');

 

Jack

Share this post


Link to post
Share on other sites
If your shop is not in the root, you will need to change this line in auto_emailer.php:
include('../includes/configure.php');

 

Jack

 

Maybe I'm misunderstanding. I can't change that line because I can't find it in any of the auto_emailer.php files in any of the folders.

 

I even checked the install files (under various folders) that had auto_emailer.php and I can't find the line to change that you mentioned.

 

If you meant for me to add it, with path do I need to follow to which auto_emailer.php file.

 

Sorry for the need for specific's but I can't find it..

 

Jerry

Share this post


Link to post
Share on other sites

Are you using the one named V 1.3? The first upload on that page should not be there and if you are using it, that is the problem.

 

Jack

Share this post


Link to post
Share on other sites
Are you using the one named V 1.3? The first upload on that page should not be there and if you are using it, that is the problem.

 

Jack

 

 

Found the problem after checking my version.

 

A version 1.3.1 (I believe was updated by pinto192 reference an output file) is apparently not the most current version. The one listed before it has the mentioned file. If you check v1.3.1 you will notice auto_emailer.php doesn't include the file you wanted me to update.

 

After your help I have the right install and everything seems to work fine. Thank you very much for your help and a Great Contribution!

Share this post


Link to post
Share on other sites

Hello Jack,

 

Many many thanks for this wonderful contribution

and all the hard work you have put in to it.

It is not very often you see a really commercially USEFUL

contribution to OSC. This is a grat one.

 

I have managed to install with all the bug fixes along the way,

and am in the process of tryingit.

My CRON statement didn't seem to work, will come back to it

later. For now I try in the browser. I got test messages for

announcement though around 200 at a time as I have a customer

list of about 4000. I presume this is the host limiting

the outgoing messages at one time. Not sure about that.

will have to check with the host though it is a dedicated server.

 

So ihave unchecked the announcement and am trying the

CUSTOMER. I keep getting the following error

+++++++++++++

[sun Jan 29 02:18:58 2006] [error] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /home/affili43/affili43-www/catalog/admin/auto_emailer/auto_customers.php on line 61

[sun Jan 29 02:18:57 2006] [error] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /home/affili43/affili43-www/catalog/admin/auto_emailer/auto_customers.php on line 61

[sun Jan 29 02:18:48 2006] [error] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /home/affili43/affili43-www/catalog/admin/auto_emailer/auto_customers.php on line 61

+++++++++++++++++++++++

 

Line 61 in the file is fwrite( $_fp, $_csv_data );

 

However the same call is made before on line 31

+++++++++++++++++++++++++++++

 

Do you have some idea what is going on here ?

 

Best regards and many thanks in advance

Share this post


Link to post
Share on other sites

I've trouble: I always send by this contribution announce emails in text format.

How can I solve this?

Thank you


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Line 61 in the file is fwrite( $_fp, $_csv_data );

 

However the same call is made before on line 31

+++++++++++++++++++++++++++++

 

Do you have some idea what is going on here ?

 

Best regards and many thanks in advance

Try placing this before the line that is failing

echo 'CSV for '$name.' - '..$_csv_data."\r\n";

You should reveive an emil containg what is in that variable. It must not be valid for some reason. See if it is failing for just one customer or just the first one.

 

Jack

Share this post


Link to post
Share on other sites
I've trouble: I always send by this contribution announce emails in text format.

How can I solve this?

Thank you

I think the previous posts by mr_absinthe mentions having the same problem. He had to use the built-in mail functions to get it to work as I recall.

 

Jack

Share this post


Link to post
Share on other sites
Try placing this before the line that is failing

echo 'CSV for '$name.' - '..$_csv_data."\r\n";

You should reveive an emil containg what is in that variable. It must not be valid for some reason. See if it is failing for just one customer or just the first one.

 

Jack

 

Hello Jack

 

Many thanks for your reply.

I have tried the cUSTOMER report again

but it seems to hang for a long time without any E Mail output.

As we have a list of 4000 customers, I tried again only

with the customer Checked in the admin set up leaving

out all other columns in the table. It still doesn't output

Not sure if it is a server issue.

 

As for the New product report it worked but with the same

multiple language issue described before in the forum

More over it produced ALL (more than 200 products)

THREE times each for ALL customers. even though

the Date was sey up ffrom First of Jan 2006 in the admin.

Somehow the admin set LIMIT was not applied

 

GOOD thing you have provided a way to test,Imagine

it going that way to the entire customer list !

 

I think the NEW product and the Announcement

are the two very useful features as the ORDERS and CUSTOMER

are easily accessed from the OSC admin.

 

The proposed feature for REVIEW follow up will be very

useful too.

 

I ave an issue with your LINKS contributionwhich I shall PM to you.

Share this post


Link to post
Share on other sites

I'm not sure what effect having 4,000 customers will have. Maybe that is part of the problem. If your problem is like the other I mentioned, then you will need to change the email functions in the contribution.

 

If you have a Links Manger question, it should be asked it in the Links Manager support thread.

 

Jack

Share this post


Link to post
Share on other sites

Help me!

I've this in autoemailer/auto_announce.php:

		 // Mail it
	// $tmessage->SetHtmlContent($message);
	// $serverFileMimeType = 'text/html';
	// $tmessage->SetFileContent($pathToServerFile, $serverFileMimeType);
	 // $tmessage->Send();
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: postmaster@100asa.it' . "\r\n";
mail($Recipiant, $Subject, $message, $headers);
  }
 }

but the email message is this:

Content-type: text/html; charset=iso-8859-1
From: postmaster@100asa.it



	 <html>
	  <head>
	   <title>Happy birthday</title>
	  </head>
	  <body> 
<!-- start message //-->
auguri 
<!-- stop message //-->
	 </body>
	 </html>

 

I see the html code! Why this?


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×