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.
Results 1 to 6 of 6
  1. #1
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending email from web site

    I have some php code that sends emails to nominated people. The nominated people are stored on a database (MySQL) with their email addresses (It is a small club of 220 people) and these are retrieved as addresses for the email.

    This has worked in the past but now I am finding that a lot of mail service providers are blocking the emails as they believe that they are spam.

    So, I am looking for a better solution. I am told that I should use asp but don't know whether this is the correct route or not. I don't know asp but, in particular, I don't know how you can mix php and asp on the same web page.

    My Service provider has set up an smtp address with username and password but I'm not even sure how I use this.

    Can anyone please help with the asp/php question and point me in the right direction (things to read) to set up a suitable emailing system.

    Or should I be looking at something like swiftmailer?

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,415
    Thanks
    269
    Thanked 32 Times in 31 Posts
    Well in my experience you really need to find out exactly what the issue is. If the members in your club are marking this as spam then that is how it should work because they should have control and if they did mark them as spam then you either live with it or you send them an internal email on your site and tell them to mark it as safe.

    I actually have that in my TOS that they must accept my emails from my social site.

    Now if that is not the issue then you need to check with your ISP and make sure they are not blocking them.

    If that is not the issue and it is the email clients such as yahoo and hotmail and the like, then i suggest you contact them as there is a reason.

    Quite a long time ago and i dont even know if they still do this as msn and hotmail has made so many changes in what they do and what they dont anymore (they seem to be hacking their freatures to death streamlining their services), hotmail and msn used to have a support section or email that you could submit your siteemail to in order to be preapproved as not spam. Once they determine that you did not have malicious motives then you were approved and at least until someone marked you as spam you were good to go. But as i said i do not even know if that is still the case or not.

    here is the info on SMTP

    http://en.wikipedia.org/wiki/Simple_...nsfer_Protocol

    Basically you should be able to set up your site email to use SMTP in your Cpanel at last i remember (im not 100 percent on that). I usually do it thru my scripts but yours might not have that feature.

    The bottom line is you need to make sure you know exactly what is happening to your email before you decide on how to fix it. Talk to your members if it is only 200 it should be easy enough to find out.

    ps.. however i would stay away from email services that promise to take care of your email needs, this is just my opinion (IMO) however. IMO you are much better off handling your own affairs.

    Hope this helps.

  • #3
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Durangod.

    Contacting all the members is not really viable. They live all over Europe and use a variety of different Email Service providers. They are also, in the main, not computer literate.

    Even my own email service provider blocks emails sent to me by my own web site and there is nothing that, apparently, I can do about it. I even had a Company (actually for my car insurance) who sent me an email and it was rejected. I actually got them to forward that email to a hotmail email address that I have and it came through okay.

  • #4
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is the php code that I am using and I get a failed message....
    PHP Code:
    $to "myname@hotmail.com";
     
    $subject "Hi! from test";
     
    $body "okay";

     if (
    mail($to$subject$body)) {
       echo(
    "<p>Message successfully sent!</p>");
      } else {
       echo(
    "<p>Message delivery failed...</p>");
      } 
    ...I can't work out why. Can anyone help pelase?

  • #5
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,361
    Thanks
    61
    Thanked 530 Times in 517 Posts
    Well your code doesn't set the from or return paths so that will instantly go against you when it comes to spam filters..

    Google phpmailer and use that instead. Not only will it let you set these properties but it will also allow you to connect to a SMTP server and send your emails through it.
    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!

  • #6
    New to the CF scene
    Join Date
    Aug 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    clipping path

    Nice post ! the language PHP is user friendly and easy to use ,thanks for sharing,thanks a lot...


  •  

    Tags for this Thread

    Posting Permissions

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