Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts
    We aren't exactly pleased with our hosting company either and will possibly be transferring to a different company.

    We know the emails are not sending because we have included our own emails in the mailing list as well as other people we know and have never received any of the emails.

    We also started getting the error message 'No recipient addresses found in header', which has never been there before and we haven't altered any of our php code.

    Any solutions I've found online for this error message so far aren't applicable as we've already had the recommended fixed code in place.

  2. #17
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Yeah, I think you may need to seek a new host.
    All I know for sure, is that the error you have is coming from sendmail. Why its that way I'm not 100% sure. The email would be the most probable cause.
    If your host is counting unsent emails, that tells me they have an issue on their end, and are incapable of determining if mail was sent properly. How they would fix it I haven't a clue.
    But it doesn't appear to be your PHP code. You could clean it up a bit, remove redundancy in the loop from static strings, and verify emails and whatnots, but all and all it looks like it will run properly.

  3. #18
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,346
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Quote Originally Posted by KatieK View Post
    We also started getting the error message 'No recipient addresses found in header', which has never been there before and we haven't altered any of our php code.
    I've already commented on this. Your hosts php / sendmail configuration has changed. Those blank emails addresses you mentioned earlier were previously not being reported to you but now they are. It's probably always been a problem but because you never saw any error messages you thought it was ok.

    Sounds like your host has tinkered with the error reporting settings (and a few others).
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  4. #19
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Thanks, it makes sense now why that error started popping up out of nowhere. Problem is even when we change the query to only get the emails that aren't blank none of the emails send. We don't get the 'no recipiants' message anymore but the php mail still isn't working.

    It seems like the problem is on our hosting company's end but they aren't cooporating and insist nothing has changed.

  5. #20
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by KatieK View Post
    Thanks, it makes sense now why that error started popping up out of nowhere. Problem is even when we change the query to only get the emails that aren't blank none of the emails send. We don't get the 'no recipiants' message anymore but the php mail still isn't working.

    It seems like the problem is on our hosting company's end but they aren't cooporating and insist nothing has changed.
    Don't forget you don't need to actually send email. Log the results to a file instead of mailing to see what's going on, or even print them to the screen.

    Yeah, to me it still reeks of the host configurations, and its almost like their not sure what they did to break it.

  6. #21
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,346
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Sounds to me like a host operating from a space PC in the basement if you ask me!
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  7. #22
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts
    So now we were told we need to specify the relay server in our code for this to work. I have the server address given to us but i'm not sure how to go about adding it. Any ideas?

    Our host is godaddy by the way, from hours spent online looking into this it's a common problem people have with them and everyone seems to solve the problem in a different way. Sigh..

  8. #23
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,346
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Switch to PHPMailer instead. It's a class that supports not just sendmail but also SMTP relays such as the one your host has specified.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  9. #24
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Yeah, phpmailer will use direct sockets to manage the mail I believe.
    As for godaddy, yes these have been hit or miss. I've seen half of the posts working with godaddy mail() and the other half not (not just you, user wise).
    What they want you to do is pass the information required over to a script that sends. I don't know the fields I'm afraid, but they should have a FAQ with what you can use. You can do it directly by changing your form action to point at their scripts, or you can submit your forms, and use curl to submit it to their forms. For what you have here, you'd need to curl (I'm pretty sure if I recall previous posts on their forms, it is passed by post). I'd suspect that you'll have a full FAQ and tutorial somewhere on their site to guide you through setting this up.

  10. #25
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Have you tried using the optional sendmail flag (-f)?

    PHP Code:
    $mail mail("someone@example.com","subject","my message","From: mycompany@example.com","-fmycompany@example.com"); 

  11. #26
    New Coder
    Join Date
    Sep 2010
    Posts
    69
    Thanks
    8
    Thanked 0 Times in 0 Posts
    After messing around with this for a while I've found some php mail code that works. Can't say I understand why this works and our other code didn't but it's posted below. Thanks all

    PHP Code:
    mysql_connect("dbserver""dbusername""dbpassword") or die(mysql_error()); 
    mysql_select_db("dbname") or die(mysql_error()); 
    $result mysql_query("SELECT email FROM email_list WHERE email != '' ") or die(mysql_error());


    while (
    $row mysql_fetch_array($resultMYSQL_ASSOC)) { 


    $email$row['email'];
    if(isset(
    $_POST['upload'])){
        if(
    $goodtogo =="alliswell"){
        
    $message "<html><body><center>
    <table border='0' bgcolor='#8a6754' width='850'>
    <tr><td align='center'><img src='http://website/images/logo.png'></td></tr>
    <tr><td align='center'><font color='#ffffff'>The newsletter for website.com has been updated. To view it, <a 
    href='http://website.com/newsletter.php'>click here</a><br><br><br>
    <em>Adobe Acrobat Reader is needed to view this newsletter. To download this free software click the link below</em><br>
    http://get.adobe.com/reader<br><br>
    </font></td></tr></center></body></html>"
    ;

    $headers 'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type:text/html;charset=utf-8' "\r\n";
    $headers .= 'From: Name <email@email.com>' "\r\n";
    $headers .= 'Return-Path:<email@email.com>' "\r\n"

    $mailmail("$email""subject""$message""$headers");
    }}}
    if (
    $mail) {
        echo 
    "<font color='#ffffff'><br><br><em>A notification was successfully sent to the mailing list.<br></em></font>";}
    else if (!
    $mail){ 
    echo 
    "<font color='#ffffff'><br><em>There was an error, please try again later.</em></font>";}
    ?> 

  12. #27
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Are you sure? The $mail check only occurs after all the looping is complete, so it will only contain the last result of the mail() call.
    Not sure why that may change it. Neither the mime or the return-path are required.
    You should look into using the Pear mail package. It's better than using mail if you want to bulk it up.

  13. #28
    New to the CF scene
    Join Date
    Apr 2012
    Location
    Scottsdale, AZ
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by KatieK View Post
    After messing around with this for a while I've found some php mail code that works. Can't say I understand why this works and our other code didn't but it's posted below. Thanks all
    If you are still having any issues I would be more than happy to look into this issue if you PM me your account number or domain name.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •