Hello,
I moved my website from one server to another and want to use the mass mailing feature and it is not currently working.

Here is the current script. The variables are pulled from the SQL database beforehand.


open SENDMAIL, "|$sendmail -t";
print SENDMAIL "To: \"$toname\" \<$toemail\>\n";
print SENDMAIL "From: \"$error{'From name'}\" \<$error{'From email'}\>\n";
print SENDMAIL "Content-type: $ctype\n";
print SENDMAIL "Subject: $FORM{'subj'}\n\n";
print SENDMAIL $FORM{'msg'};
close SENDMAIL;

The question is, my cpanel says, "Path to sendmail /usr/sbin/sendmail"

Do I have I have to script the routing to Sendmai? If so would I modify this
script and how?

Thanks for the help.
davelandon

Hi Dave,
you're not giving us the whole script, are you?
$sendmail should be defined somewhere. That's where your path to sendmail goes.

BTW: This method of sending e-mails is bad, read something about e-mail injection:
http://en.wikipedia.org/wiki/Email_injection

If you you're still having problems with sending through sendmail (it could be that -t is forbidden, for instance) and you cannot use built-in mail() function (the easiest way ever, although even there you have to care about e-mail injections) I recommend using XPertMailer library:
http://xpertmailer.sourceforge.net/

It may be a bit of a hard nut for you to crack at first as you are probably a PHP beginner, but the reward is worth it. You can for instance, send HTML e-mails with it like a breeze, or send e-mails using the recipient's mailserver (read from MX query).

Comments
nice

The problem was not in the script, but the response time. I clicked send 5-6 times over two hours testing alternatives before the mails started comein through. I will look into alternatives.

This question has already been answered. Start a new discussion instead.