Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Sending an Email through PHP

Options
  • 27-11-2006 4: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,943 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 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 Posts: 7,468 ✭✭✭Evil Phil


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


  • Registered Users Posts: 68,317 ✭✭✭✭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