#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2

    [Q]create mailing list from sql database


    hi:
    i have this code..
    type address for form and it displays all names and email
    address from sql database.
    i type in message into box and send.
    the connection is successful ..
    the mail gets processed but no emails are sent.
    i use this on a real web host.. not xammp etc.

    i think the problem may be in this line but every change i tried
    doesnt work.. ::
    PHP Code:
    ini_set("SMTP""mail.tap~~.com"); 
    full code here:

    PHP Code:
    require('connect.php');

    // change php.ini smtp line
     
    ini_set("SMTP""mail.tap~~.com");

    // standard mail header
    $headers "From: Tap~~";

    // get meessage to send
    $message $_GET['message'];

    // loop through names / emails on index form
    for ($x=0$x<count($_GET); $x++)
    {
        if (
    $_GET["mail_$x"])     
        {
             
    // mail setup
             
    $to =  $_GET["mail_$x"];
             
    $subject "News From Tap~~";
             
    $body =  "Dear " $_GET["name_$x"] . "
             \n\n 
    $message \n\n Josh \n\n Tap~~ ";
             
             
    mail($to$subject$body$headers );
        }
    }

    echo 
    "All Mail Has Been Processed"
    i really appreciate the looksy
    thanx
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,998
    Rep Power
    375
    assuming you are doing everything right, e.g. email address are fine then the mail address i.e. hotmail etc could be blocking your email.


    the code looks a bit convulated(?) and you should consider using php mailer.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2
    they are not being blocked.
    i dont know how to adapt things like phpmailer for my needs..
    fixing one tiny line should be easier for me than learning phpmailer..

    thanx
  6. #4
  7. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4123
    How do you know they're not being blocked? You won't get an alert if they are.

    You don't adapt things like phpmailer, you use it as is and you use the funtions it comes with as per the documentation.

    The alternative is writing something as comprehensive as phpmailer yourself which you've hinted you don't know how to do
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2
    gmail documentation says it does not block from any domains, or addresses..

    if i ever need to do more than this specific need, i can try to learn php.mailer..
    but for now, i really hope to fix this one thing..it really cannot be that bad.

    plus, my web site contact form submits fields to server database, and my email.. if google blocked the server, then i think i wouldnt get email from my contact form submission?

    thanx

    edit:
    http://tools.bevhost.com/cgi-bin/dnslookup?data=184.173.107.21&server=NS1.SHREW.ARVIXE.COM

    i didnt see anything that ppl say is a problem
  10. #6
  11. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4123
    I maintain a commercial application currently handling millions of marketing emails every month for a diverse range of clients.

    We set up rDNS, SPF and DKIM records for each client. Every message is digitally signed in line with DKIM to verity that it came from us and was not altered in transit. The SPF record verifies that the sending IP is allows to send on behalf of the sending domain and an rDNS check helps verify this.

    The gmail, hotmail and yahoo ISP documentation mention and promote these as a matter of course.

    If you're wanting to send emails from php, you need to know this stuff.
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2
    Originally Posted by Northie
    I maintain a commercial application currently handling millions of marketing emails every month for a diverse range of clients.

    We set up rDNS, SPF and DKIM records for each client. Every message is digitally signed in line with DKIM to verity that it came from us and was not altered in transit. The SPF record verifies that the sending IP is allows to send on behalf of the sending domain and an rDNS check helps verify this.

    The gmail, hotmail and yahoo ISP documentation mention and promote these as a matter of course.

    If you're wanting to send emails from php, you need to know this stuff.
    i called my server.. they said that their mailers
    are not blocked.. and their proof is that i get emails from their server..
    i posted this link from the tools@openspf.org :
    http://tools.bevhost.com/cgi-bin/dnslookup?data=184.173.107.21&server=NS1.SHREW.ARVIXE.COM
    tahnx
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,998
    Rep Power
    375
    we still need to know if those variables are actually "fine" and have the correct value. echo out the values and see if you are not doing anything wrong

    start by sending ONE mail and then go from there.
  16. #9
  17. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4123
    There are hundreds of reasons an email might get blocked. Make the analogy with postal mail - you may have the address right and it may have landed on the doormat of your recipient but the internal mail system of the recipient may decide not to deliver it to the persons inbox
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2
    @paulh1983 thanx, i have tried to do some of this , but not very good at recognizing what to change .. to pinpoint the prob

    @northie.. ive done all i can to check into blocked email
    i have to put this at the lower of possibilities at this point..


    thanx
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,998
    Rep Power
    375
    start with echoing out the var see if they are right. You need to check if php can send the mail.. just using mail() doesnt do anything. smtp? settings need to be there by your web hosts (i am sure soemone else can elaborate a bit more)
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2
    Originally Posted by paulh1983
    start with echoing out the var see if they are right. You need to check if php can send the mail.. just using mail() doesnt do anything. smtp? settings need to be there by your web hosts (i am sure soemone else can elaborate a bit more)
    i appreciate your revisiting this ..
    i do not know how to echo out the var one by one.
    really, i need an example for this..

    i did call the web host. they told me that all is enabled
    and dont have to do anything special when i am using from my own domain .. not even the port number,
    which they did say is 25.

    i put the 3 php files to github here... i am trying to also set up
    phpmailer for database ..trying to follow their examples.. i am clumsy and slow..
    nothing is working for me at this point..

    again, i get successful connection message and emails have
    been processed message,,
    no errors anywhere.. just no emails are sent

    https://gist.github.com/amkaos/5608094

    thankyou
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    30
    Rep Power
    2
    Originally Posted by Amkaos
    i appreciate your revisiting this ..
    i do not know how to echo out the var one by one.
    really, i need an example for this..

    i did call the web host. they told me that all is enabled
    and dont have to do anything special when i am using from my own domain .. not even the port number,
    which they did say is 25.

    i put the 3 php files to github here... i am trying to also set up
    phpmailer for database ..trying to follow their examples.. i am clumsy and slow..
    nothing is working for me at this point..

    again, i get successful connection message and emails have
    been processed message,,
    no errors anywhere.. just no emails are sent

    https://gist.github.com/amkaos/5608094

    thankyou
    please mark as solved.. i made php.ini and send.ini then uploaded to server.. all works fine now..

IMN logo majestic logo threadwatch logo seochat tools logo