Search code examples
phppear

Getting around email restrictions with hosting providers


So my hosting provider is limiting emails sent out to 2 at a time, which means no array of emails.Right now I'm using Pear to send html emails to multiple users who sign up together.

Is there a solution to loop through the mail() function multiple times ultimately sending out multiple emails? How will the performance be?

The hosting company actually suggested we look for some solution to by pass their restrictions, but i don't know where to look.

Thanks


Solution

  • You could just iterate over the array of email addresses? I assume your use case is more complex than this, but it should get you on the right path:

    <?php
    foreach ($emails_array as $email)
    {
        mail($email, ....); //or whatever your mail call is
    }
    ?>