Jump to content

Recommended Posts

Hi guys,

few months ago I've started a new project - http://stdimitar.org.

The site was deployed and is being hosted by godaddy Economy hosting plan.

I've created a php script using a php based mail function to send a mass of e-mails to our subscribers, around 1000 mails a day.

My problem is that I don't know how many emails are actually sent to their email accounts.

If anybody knows a better way to solve the problem, please tell me.

I want to share my script and so sorry for my English.

jazzman

<?php
if (isset($_POST['Submit'])) {
$local = $_SERVER['SERVER_NAME'];
$subject = $_POST['subject'];
// associative array, this data comes from database
     $headerFields = array('BCC:  example_1@example.com,example_2@example.com,example_3@example.com,example_4@example.com,example_5@example.com');
     $headers = 'MIME-Version: 1.0' . "\n" .
                 'Content-type: text/plain; charset=UTF-8' . "\n" .
                 'Content-Transfer-Encoding: base64' . "\n";
                 'X-Priority: 1 (Higuest)' . "\n";
                 'X-MSMail-Priority: High' . "\n";
                 'Importance: High' . "\n";
      $headers .= implode(',', $headerFields)."\n";
      $message = ''."\n";
      $message .= $_POST['message'] . "\n";
      // link to image or church bulletin
      $message .= 'http://' . $local . '/'. $folder_img.'/'. $filename ."\n";
      if(mail(null, '=?UTF-8?B?'.base64_encode($subject).'?=', base64_encode($message), $headers . '')){
     echo "Mail has been successfully sent"; exit;
      }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Send a message to subscribers</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <fieldset>
            <legend><h2>Crop new image and send a message to subscribers</h2></legend>
            <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" enctype="multipart/form-data" accept-charset="utf-8">
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr  align="left" valign="top">
                        <th>Title:</th>
                        <td><input type="text" name="subject" value="" /></td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr align="left" valign="top">
                        <th width="160">Message:</th>
                        <td><textarea row="30" cols="50" name="message"></textarea></td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr align="left" valign="top">
                        <th>Send image:</th>
                        <td><input type="file" name="fupload" value=""/></td>
                    </tr>
                    <tr><td> </td></tr>
                </table>
                <input type="submit" name="Submit" value="Go" />
            </form>
        </fieldset>
    </body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/264079-sending-mass-e-mail-from-godaddy/
Share on other sites

Using the mail() function and generating that "mail was successfully sent" message will tell you if the message sent successfully.  The best way to verify that is it being delivered is to set a "from" addresses in the $header variable so that our system or the remote system knows whom to notify if delivery fails.  Just remember to use an email address you setup with Go Daddy for this.

 

Also, Go Daddy shared hosting limits you to 1000 emails per day so anything more than that will not send properly.

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.