Jump to content

ayok

Members
  • Posts

    340
  • Joined

  • Last visited

    Never

Posts posted by ayok

  1. If you are getting emails with time values in them that are 6 minutes apart, then your script is being executed multiple times. You are either requesting/refreshing the page again or you have a cron job/scheduled task that is requesting it with a 6 minute interval.

     

    Hmm... Maybe I need to check about this.

     

    The counter WILL be the same value for any particular email address. All the "John" emails will have a count of 1, all the "Mary" emails will have a count of 2, and all the "Rob" emails will have a count of 3. If you mean that ALL the emails have the same count, I doubt it. What exact count values are you getting at each test email address?

     

    So. John = 1, 2 times

    Mary = 2, 2 times and

    Rob = 3, 2 times.

     

    Edit: The last code you posted above is setting the $sendContent variable AFTER you have used it in the $mail->MsgHTML() method. So, the first email to the test "John" account isn't going to contain any message body. I recommend re-ordering your code so that it assigns the string to $sendContent before it calls $mail->MsgHTML().

     

    I'll check this one too..

    Thanks!

  2. I've set a time on the content. The duplicates are sent 6 minutes after the first.

    I've also set an order number, and all the duplicates has same number.

     

    <?php
    require("PHPMailer/class.phpmailer.php");
    $mail = new PHPMailer();
    $mail->SingleTo = true;
    $mail->CharSet = "UTF-8";
    $mail->Subject = "Fiscanet Nieuws";
    $r_receivers = array("John"=>"john@mail.com","Mary"=>"mary@mail.com","Rob"=>"rob@mail.com");
            $i = 1;
    foreach($r_receivers as $name=>$email){
    	$mail->SetFrom('no-reply@yoursite.com', "Yoursite");
    	$mail->MsgHTML($sendContent);
    	$mail->AddAddress($email, $name);
            $sendContent = "<p>This is test mail number ".$i." sent at ".date('H:i:s')."</p>";
    	if($mail->Send())
    		echo "Sent to: ".$email."<br/>";
    	else
    		echo "Not sent to: ".$email.", reason: ".$mail->ErrorInfo."<br/>";
    	$mail->ClearAddresses();
                    $i++;
    }
    ?>
    

  3. Hi. Thanks for your reply.

    However, I have put $mail->ClearAddresses() on my code, and it doesn't help. I've also tried to put it before the addAddress().

     

    And it's also strange that I got the same amount of duplicates. My logic said, it should send 3 emails to the first and just 1 email for the last. But mostly I received 2 emails on all 3 email addresses.

  4. Hi,

    I have this problem like some people with PHPMailer, and I cannot find any solutions on the internet. The problem is that PHPMailer sends duplicates (sometimes more than two) if I set it in a loop (while, foreach). I've checked the loop is just fine, but it keeps sending duplicates.

     

    Here is the code after I made it looks simpler.

    <?php
    require("PHPMailer/class.phpmailer.php");
    $select = mysql_query("SELECT * FROM `pm_mailmembers` WHERE `mm_interval`='2' AND mm_blocked = 0") or die(mysql_error());
    $mail = new PHPMailer();
    $mail->SingleTo = true;
    $mail->CharSet = "UTF-8";
    $mail->Subject = "Fiscanet Nieuws";
    $sendContent = "<p>This is test mail</p>";
    $r_receivers = array("John"=>"john@mail.com","Mary"=>"mary@mail.com","Rob"=>"rob@mail.com");
    foreach($r_receivers as $name=>$email){
    	$mail->SetFrom('no-reply@yoursite.com', "Yoursite");
    	$mail->MsgHTML($sendContent);
    	$mail->AddAddress($email, $name);
    	if($mail->Send())
    		echo "Sent to: ".$email."<br/>";
    	else
    		echo "Not sent to: ".$email.", reason: ".$mail->ErrorInfo."<br/>";
    	$mail->ClearAddresses();
    }
    ?>

    I think I need to reset mail->addaddress inside the loop, but mail->clearaddresses doesn't help. And all 3 emails always receives the same emails. So all receives 2 or 3 mails.

     

    Could anyone help me out here?? Thanks.

    ayok

  5. Hi, I have a question about array.

    For example I have this array:

    Array( [0] => Array ( [john@myemail.nl] => John ) [1] => Array ( [mary@myemail.nl] => Mary ) )

    How can I make it like

    Array( [john@myemail.nl] => John [mary@myemail.nl] => Mary  )

    ?

     

    Thank you

  6. Hi,

    I have a site which is going much slower to download when there are more items. I think it's caused by the queries in the site, but I really don't know which query. Is it the mysql_num_rows? Or searching queries? There is a long "where" filter. Has anyone experienced this? Any suggestions?

     

    Thanks,

    ayok

  7. Hi,

    I have a question about uploading large files to webserver. It takes always long time to upload files like joomla! or magento site through FTP like filezilla which can have more than 10000 files. Is there any faster way to do this?

     

    Thanks,

    ayok

  8. Also, I just used the html source that I saved from my browser (Firefox) and it validates processes at the w3.org validator.

     

    I would say this is most likely a user agent issue.

     

    Hi thanks..

    Sorry, I don't really understand what do you mean by user agent issue. Is it browser issue?

  9. Hi,

    I'm trying to use if in mysql query, but can't get it work.

    So the case is i want to select rows when siteid is not zero, if it's zero then I need to cancel the where.

    I've tried

    SELECT * FROM items WHERE IF(siteid > 0,$siteid,0) = $siteid

    With this query I got good result when $siteid is not 0, but it returns empty when $siteid = 0, which actually select siteid = 0. What I need is no more where, so it should just returns all.

     

    Could anybody help me here?

     

    Thanks

    ayok

  10. Hi,

    I have a question. I want to redirect old urls to a new url using htaccess, but there are too many old urls.

    However, it has a pattern. The links are always like 23_34_pagecategory_pagename.htm.

    How do I do 301 redirect on .htaccess?

     

    Thank you,

    ayok

  11. Hi,

    I got a problem with w3c html checker (The client checked it). It gives me this error for this specific site http://www.watersport4all.nl like:

    A fatal error occurred when attempting to decode response body from http://www.watersport4all.nl. Either we do not support the content encoding specified ("none"), or an error occurred while decoding it.

    The error was: Don't know how to decode Content-Encoding 'none'

     

    I don't really understand because if I take a look on the source codes it shows me charset=utf-8. The site is made with joomla! cms.

     

    Could someone please help me out to find the problem here? Thank you!

     

    Ayok

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.