nbruim Posted February 14, 2015 Share Posted February 14, 2015 Hello all! New to PHP so I might be asking noob questions. In order to send emails from PHP, do you need to declare the smtp details? Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/294619-php-email-help/ Share on other sites More sharing options...
kierany5 Posted February 14, 2015 Share Posted February 14, 2015 You can use the mail() function, which on linux uses sendmail (or postfix, etc). Windows requires additional tools. You could also use a library like PHPMailer. You can use SMTP using this library. Quote Link to comment https://forums.phpfreaks.com/topic/294619-php-email-help/#findComment-1505714 Share on other sites More sharing options...
nbruim Posted February 14, 2015 Author Share Posted February 14, 2015 What if I'm using Android Studio with the PHP file? Would that make a difference? Quote Link to comment https://forums.phpfreaks.com/topic/294619-php-email-help/#findComment-1505715 Share on other sites More sharing options...
scootstah Posted February 15, 2015 Share Posted February 15, 2015 Why would you use an Android IDE for PHP? Quote Link to comment https://forums.phpfreaks.com/topic/294619-php-email-help/#findComment-1505747 Share on other sites More sharing options...
nbruim Posted February 15, 2015 Author Share Posted February 15, 2015 I use my php file kind of like a web API, with Android Studio. Quote Link to comment https://forums.phpfreaks.com/topic/294619-php-email-help/#findComment-1505752 Share on other sites More sharing options...
kierany5 Posted February 15, 2015 Share Posted February 15, 2015 So that's what it is, an IDE. I had not idea what Android Studio is. When I referred to windows or linux, I meant the machine the PHP is being executed on. For example, I develop on a mac but my code is executed on one of my servers, all running a distribution of Linux. So, if your code is being run on a windows machine you'll need to download some additional libraries to send straight from the script if you don't want to use SMTP. Once again, I seriously recommend PHPMailer or some other library - they cut out the non-sense you have to go through when sending html emails, etc. Quote Link to comment https://forums.phpfreaks.com/topic/294619-php-email-help/#findComment-1505764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.