You are not logged in.
#51 06 Jun 2007 11:50 am
Re: Sending mails
in process_send_mail.php you break your post values out into variables, then use the posted values (which, where is $_POST['headers'] comming from? I didnt see that as an input to be posted).
not to beat a dead horse, but if mail_to contains a list of email address, then you're going to have a malformed to address (RCPT TO: <addr>, not RCPT TO <add, addr, addr> since thats not a valid email address, but multiple emails inside a single email bracket).
Code:
... if(($error = sendmail('', $_POST[subject], $_POST[message], $headers)) != false) { ...
there may be others but this is the immediate problem.
Offline
#52 07 Jun 2007 1:12 pm
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Hmm, the $header, was supposed to be the CC, but I didnt figure out if it worked, or if it would work having all mails in the original To: field or not.
Code:
<?php $check = $_POST['check']; $tostr = ""; foreach($check as $to) { $tostr .= $to; $tostr .= ", "; } $tostr = trim($tostr, ', '); echo $tostr; ?>
Would as known output addr, addr, addr, addr, addr and so on, but should there be a < before and > after? Only problem remaining with this script is the address system, which messes with my head big-time.
Offline
#54 08 Jun 2007 4:48 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
I tried a new twist on the process page, doing this:
Code:
<?php include("../db_connect.php"); $ID = mysql_real_escape_string($_POST['ID']); $subject = mysql_real_escape_string($_POST['subject']); $message = mysql_real_escape_string($_POST['message']); $from = mysql_real_escape_string($_POST['from']); $date = mysql_real_escape_string($_POST['date']); $ip = mysql_real_escape_string($_POST['ip']); $mail_to = "backupmail@address.com"; //$mail_to = $_POST['mail_to']; $headers = $_POST['mail_to']; //$headers = "cc: $mail_to"; echo "<strong>Message was sent to: </strong>"; echo $headers; echo "<br>"; echo "<br>"; $header = '<' . $headers . '>'; //mysql_query("INSERT INTO `sentmail` VALUES ('$ID', '$mail_to' , '$subject', '$message', '$from', '$date', '$ip')"); include("smtp.php"); //if(($error = sendmail($_POST[mail_to], $_POST[subject], $_POST[message], $_POST[headers])) != false) { if(($error = sendmail($mail_to, $subject, $message, $header)) != false) { echo 'Failed to send the email, and the error message was: <b>' . $error . '</b>, please forward this error to the system administrator.'; } echo " A mail with this subject: <strong>" . $subject . " </strong>, has been sent:<br />"; echo " Message: <strong>" . $message . " </strong><br />"; echo " Author:</strong> <strong>" . $from . " </strong><br />"; echo " Date:</strong> <strong>" . $date . " </strong><br />"; echo " the information was also added to the database, you will be redirected in 10 seconds."; ?>
Notice the $header = '<' . $headers . '>';, which should put it as <addr, addr, addr>, I was quite sure this would format it correctly, but got this message: Ran into problems sending Mail. Response: 550 Administrative prohibition
If I am going to send something as CC by the header, should it then be $header = 'CC: ' . $mail_to . ''? Is the CC: the trigger for sending it as Carbon Copy?
Offline
#56 09 Jun 2007 9:05 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Ok, then this:
Code:
$mail_to = "backup@address.com"; $headers = $_POST['mail_to']; $header = 'CC: ' . $headers . '';
Should make him send a single mail to backup@address.com, and send the rest as CC to the recipients. Though, I got the same error: Ran into problems sending Mail. Response: 550 Administrative prohibition, does that error message mean that the password/username is incorrect?
Offline
#57 09 Jun 2007 1:56 pm
Re: Sending mails
Code:
<?php include("../db_connect.php"); $ID = mysql_real_escape_string($_POST['ID']); $subject = mysql_real_escape_string($_POST['subject']); $message = mysql_real_escape_string($_POST['message']); $from = mysql_real_escape_string($_POST['from']); $date = mysql_real_escape_string($_POST['date']); $ip = mysql_real_escape_string($_POST['ip']); $mail_to = "backupmail@address.com"; //$mail_to = $_POST['mail_to']; $headers = "cc: ".$_POST['mail_to']; echo "<strong>Message was sent to: </strong>"; echo $headers; echo "<br>"; echo "<br>"; $header = '<' . $headers . '>'; //mysql_query("INSERT INTO `sentmail` VALUES ('$ID', '$mail_to' , '$subject', '$message', '$from', '$date', '$ip')"); include("smtp.php"); //if(($error = sendmail($_POST[mail_to], $_POST[subject], $_POST[message], $_POST[headers])) != false) { if(($error = sendmail('', $subject, $message, $headers)) != false) { echo 'Failed to send the email, and the error message was: <b>' . $error . '</b>, please forward this error to the system administrator.'; } echo " A mail with this subject: <strong>" . $subject . " </strong>, has been sent:<br />"; echo " Message: <strong>" . $message . " </strong><br />"; echo " Author:</strong> <strong>" . $from . " </strong><br />"; echo " Date:</strong> <strong>" . $date . " </strong><br />"; echo " the information was also added to the database, you will be redirected in 10 seconds."; ?>
Offline
#58 09 Jun 2007 3:11 pm
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Now he tells me: Ran into problems sending Mail. Response: 503 valid RCPT command must precede DATA
So, there MUST be a main recipient?
Offline
#60 10 Jun 2007 1:59 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
It still gives me the: 550 Administrative prohibition warning. Could it be my host changed something to the mail system?
Offline
#61 10 Jun 2007 10:14 am
Re: Sending mails
http://kb.mozillazine.org/Administrative_Prohibition
sounds like your from address isn't authenticating with the mail server. might be a good thing to ask your host about.
Offline
#62 10 Jun 2007 1:14 pm
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Well, after 1 hour on their "live chat" and too many minutes on the phone support (which cost me a whopping 1 dollar a minute) I got another live chat running and finally got an answer. They have suspended the script because they think I am using it for spam, but I have submitted a ticket to have the suspension lifted, and I hope it will be done soon.
Offline
#64 11 Jun 2007 10:37 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
They claimed I sent 50 an hour, but my database begs to differ. Ahh well, they set it to 250 an hour, so it should have worked, but I still get the same error message. So now there will most likely be yet another hour at the live chat with the representative eating at burger king, and me having a monologue whilst watching a movie.
Offline
#65 14 Jun 2007 11:48 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Ok, Bluehost Roger found out this:
Code:
Per your instructions, I used the page to send a mail to addr@addr.com. It returned the following... Message was sent to: cc: addr@addr.com Failed to send the email, and the error message was: Ran into problems sending Mail. Response: 550 Administrative prohibition , please forward this error to the system administrator. A mail with this subject: Subject , has been sent: Message: Message Author: Name Date: 14th of June, 2007 the information was also added to the database, you will be redirected in 10 seconds. I searched the exim_mainlog for addr@addr.com and got the following... 2007-06-14 11:46:08 1HytOZ-00028Y-Iu H=localhost [127.0.0.1] F= rejected after DATA: syntax error in 'From:' header when scanning for sender: malformed address: : addr@addr.com may not follow no_reply@addr.comcc in "no_reply@addr.comcc: addr@addr.com" Notice the extra "c" at the end of "no_reply@addr.comcc". If you can find what is causing the domain to be misspelled, that might resolve the issue for you.
Should I leave the main recipient field empty, the "mail_to" variable, so that only Carbon Copys are sent?
Offline
#67 15 Jun 2007 9:20 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Hmm, in the process page, the only variables using the addresses are these:
$mail_to = "backupmail@address.com";
$headers = "cc: ".$_POST['to'];
As of where the $mail_to will be an address I use for backing up sent mails, and $headers are the actual mails going out. And with the function like this: sendmail($mail_to , $subject, $message, $headers)) != false), I can't see why it would combine the Recipient and Carbon Copy.
I tried just now sending to three different recipients, and the $headers variable contained this: cc: addr1@addr.com, addr2@addr.com, addr3@addr.com - I still get the "Administrative Prohibition" error, though Bluehost claims they are doing nothing wrong.
Offline
#69 18 Jun 2007 10:12 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Sons of guns, and "Administrative Prohibition" can only derive from the host having issues, not from me doing something wrong?
Sorry for the late reply, had a recurring Trojan attack on Saturday, and had to reinstall Windows and all programs with it.
Offline
#70 20 Jun 2007 1:41 pm
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Jesus below and atheist Bluehost, they keep claiming I am doing something wrong, even though the header simply says:
cc: addr@addr.com, addr@addr.com etc, I am having some serious problems discovering the error here, and if it lies with my coding or their systems.
Offline
#71 23 Jun 2007 8:16 am
- Butcher
- Moderator
- From: Norway
- Registered: Jul 2006
- Posts: 308
Re: Sending mails
Here is the chat transcript from my intriguing conversation with a Bluehost representative:
And, as he stated, these two are supposedly the only reasons for getting an "Administrative Prohibition" error (550):Conversation :
Visitor Name: Butcher
Question: Hi, my domain is$m[1]www.bamboocommandos.net/.com I have now been very patient with your support in this subject, and even though you always claim that you have not blocked my mail script, I get this error message: Ran into problems sending Mail. Response: 550 Administrative prohibition This error only derives from the host blocking something or denying the mail to be sent. I have gone through my coding with several other people, and the syntax is working for all parts of the script, so can you please tell me why you are blocking my mail script?
Representative: Hello! Welcome to our live chat. Please allow me a moment to read over your question. Keep in mind that we take multiple chats at one time so my response to your questions may take a few moments.
Butcher 5:37:00 AM: Hi, and please do not have me waiting for another hour this time.
Representative 5:39:23 AM: Give me just a moment to remedy this.
Butcher 5:52:43 AM: Waiting excitedly
5:56:09 AM: What do I need to do to get an answer from this company?!
Representative 5:56:27 AM: Be patient. Trying to get this working for you.
Butcher 5:56:53 AM: Ok, if you had said that I would not be afraid that I would be sitting here for an hour having a monologue with myself again
Representative 5:57:36 AM: Representative 5:39:23 AM: Give me just a moment to remedy this.
5:57:42 AM: I did mention it.
6:01:42 AM: Ok, try it now.
6:02:01 AM: If it isn't working after this it would only be one of two things:
6:02:16 AM: 1) You're going over your 500 outgoing emails per hour limit.
6:02:52 AM: 2) If you're using SMTP to send, you're not authenticating with the mail server.
Butcher 6:03:01 AM: Well, I get the same Administrative prohibition as usual - And I am most definately sending more than 500 mails an hour, I would doubt even 1 per hour.
6:03:04 AM: I am using SMTP though
6:03:44 AM: I am connecting with this:
6:04:13 AM: 'sender'=>'addr@addr.com',
'username'=>'addr+addr.com',
'password'=>'pw',
'host'=>'mail.addr.com'
6:04:37 AM: Which would be the credentials that I got from when I made an mail account with the CPanel
6:06:35 AM: So I am authenticating with the mail server as far as I can tell... Is there any way I can see how many mails are being sent per hour from my webserver? The only other mailfunction is within the phpBB forum, but fewest use it
Representative 6:07:21 AM: Not for the mail logs, no. Currently have a search running for the past hour searching for anything from your domain.
Butcher 6:16:55 AM: Has it found anything yet?
Representative 6:18:09 AM: Not much. Only seeing about a dozen sent mails in the last hour.
6:18:28 AM: When was the last time you tried to send out?
Butcher 6:18:32 AM: well that would be far from 500...
6:18:37 AM: A few minutes ago
6:21:03 AM: I am really wondering what is stopping it
Representative 6:36:44 AM: It really seems that you aren't authenticating with the mail server.
6:37:48 AM: If you're just running a mailing list, I would suggest switching to something like dRepresentativeail.
Butcher 6:40:17 AM: Well, this script should be working perfectly fine, the only issue is this Administrative Prohibition - And I am using the CPanel mail account I made, connecting to the mail at my domain and using the right password, so it should be authenticating perfectly well
6:44:01 AM: It uses the basic PHP sendmail function, combined with a simple SMTP script, and the recipients are all put into a Carbon Copy header, seperate as they should be with commas, the main recipient is my backup mail, and it includes everything it should. I cannot myself find any reason to why it gives me a Administrative Prohibition other than Bluehost blocking it one way or another.
6:48:39 AM: Do you have any other suggestion to what I may do to discover the error, even if it does lie with Bluehost restrictions? The mail script is set up just like I want it, and I really want it to work.
Representative 6:51:23 AM: No, those would be the only two reasons as to why you would ever receive a 550 error like that.
1) You're going over your 500 outgoing emails per hour limit.
2) If you're using SMTP to send, you're not authenticating with the mail server.
The SMTP credentials are right, the mail for sender, the password and the host are all correct, and I am not sending over 500 mails an hour, so I really cannot see why this script is still not working, or why I am getting an 550 error. Drives me nuts.
Offline
#72 23 Jun 2007 1:53 pm
Re: Sending mails
export your database schema, save it to a file. zip up the database export and the files you're using (dont change anything except to remove hosts/usernames/passwords) and email it to me. I'll pm you my email address.
Offline