Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Sending an Email through PHP

  • 27-11-2006 04:23PM
    #1
    Closed Accounts Posts: 110 ✭✭


    I keep getting this error:
    Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first 54sm18869925ugp in C:\WebServer\wamp\www\WebSite3\mailtest.php on line 8
    fail

    ....when i try to run this code
    <?php

    ini_set("SMTP","smtp.gmail.com");
    ini_set("SMTP_PORT","465");
    ini_set("sendmail_from","ertyu@gmail.com");

    if (mail("ertyu@gmail.com","This is a test","This is the body",
    "From: ertyu@gmail.com\r\nContent-type: text/plain\r\n\r\n"))
    {

    print "Success";
    }
    else
    {
    print "fail";
    }

    ?>


    but my mail works fine in outlook,
    am i doing something wrong?

    is there any other mail service besides gmail that you can use for free with outlook and stuff?


Comments

  • Moderators, Music Moderators Posts: 35,948 Mod ✭✭✭✭dr.bollocko


    I think gmail is looking for SSL authentification maybe?


  • Closed Accounts Posts: 110 ✭✭1der


    ya that seems to be the issue but how can i get around it in PHP


  • Registered Users, Registered Users 2 Posts: 71 ✭✭zdragon


    I see you are using IIS. so you can use IIS SMTP service to send emails.


  • Closed Accounts Posts: 110 ✭✭1der


    so you can use IIS SMTP service to send emails
    how do i do that????


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    1der wrote:
    how do i do that????

    Well what do you know, the first result from google gives the following URL http://msconline.maconstate.edu/Tutorials/PHP/PHP12/php12-01.php


  • Advertisement
  • Closed Accounts Posts: 110 ✭✭1der


    ya but see i dont got no IIS on my computer and ive lost me Windows Disk...


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    What webserver are you using if you're not using IIS? Maybe I'll lock this thread ...


  • Registered Users, Registered Users 2 Posts: 68,173 ✭✭✭✭seamus


    He's using WAMP. See, there are things more evil than IIS...

    You can't do it with the php mail() function. You'd have to hand-code a class or set of functions using sockets that would do it for you.

    Easier to just use your ISP's mail server instead...


  • Closed Accounts Posts: 110 ✭✭1der


    that doesnt sound like fun..
    by isp, do you mean outlook? which is my isp's mail server???


  • Closed Accounts Posts: 8,478 ✭✭✭GoneShootin


    would phpmailer help you out?

    http://phpmailer.sourceforge.net/


  • Advertisement
Advertisement