MultipleMail sometimes send and sometimes not

2012-08-17
2012-09-18
  • Jacques Mulder
    Jacques Mulder
    2012-08-17

    Hi

    I run two different emails to two different email address most of the time and
    always bcc myself just to see that the emails did actually send.

    So in one php scripts i call $mail = new PHPMailer(); twice

    Now what happens is sometimes both emails go through and sometimes only the
    one or the other one goes through.

    for instance. One user wil create three order and the first order email 1 will
    go through but not number 2, second order both emails go through and third
    email only email number two goes through.

    I did figure out that the subject has an effect. for instance if both subjects
    are very similar then only the one or the other email goes through but not
    both.

    I think this is a bug that needs to be addressed.

    Do you have a solution in the mean time or can you think why this is
    happening.

    Like I say sometimes it will work 5 or ten times in a row that both emails go
    through and then it will give issue again.

    Does not always work better after server has been restarted so cant point to
    that either.

    When I'm sending only one email at a time then its fine, but two emails give a
    problem.

    Any input would be appreciated to help solve this issue.

     
  • Jacques Mulder
    Jacques Mulder
    2012-08-25

    Has no one ever had a problem with this

     
  • Jacques Mulder
    Jacques Mulder
    2012-08-25

    Ok I think I've figured it out

    So if you have have two different emails immediately after one another then by
    using $mail = new PHPMailer(); then it's best to define a new variable for the
    second email like this $mail2 = new PHPMailer(); instead of using $mail = new
    PHPMailer(); and then again $mail = new PHPMailer();

    For some reason my server gets confused and send only the one or the other
    email if $mail is the same.

    I've just implemented the change in $mail variables and immediately it sent
    both emails at once.

    Will monitor and give feedback f this actually fixed it permanently.

    Hope this helps someone in the future.