17

#FuckPHPInTheAss

>Start working on PHP after ages.
>Found that mail() is deprecated through server support
>they suggest to use PEAR Mail
>Suggest to use deprecated PEAR code
>Fix deprecated code and magically runs on localhost
>ohmygodyess.php
>try to run on server
>fuckMyLife.exe
>Try using PHPMailer
>WTF is this How the fuck this works?
>Spends hours to understand with example code
>WorksFinOnLocal.exe
>NopeIWon'tRunOnServe.lulz
>about to use YiiMailer.

#Sleepless

Comments
  • 6
    I use PHPMailer for everything, has everything I need from html, ssl to bcc and easy debugging why a mail wasn't delivered. Just 'require' the autoloader and you're good to go.

    Not a lot of documentation for it, because it's just that simple :D
  • 0
    @BertMaurau can you give a good reason that why it works on localhost and doesn't works on a webserver?
  • 5
    @dextel2 In my case, it's mostly the other way arround, because the server has some extensions installed by default while my localhost is just the basic with some custom extensions :D

    Imo PHP has some good and clear error reporting that perfectly describes where your code hit a snag?
  • 0
    @BertMaurau seems like need authentication from gmailm.cannot work that around . Got any pointers?
  • 0
    @dextel2 StackOverflow should guide you in the right directions? :D "phpmailer gmail" and you'll probably find the answers you're looking for. Apparently SMTP acts weird for gmail when localhost or server environment
  • 0
    @BertMaurau exactly!!! It's pretty weird, I gave up Gmail after 10000 attempts and trying to work around on outlook and Outlook 365, guess what? Same authentication problem... And my webserver has gone offline... 😂
  • 1
    Ohhh yeah, Fuck that shit right onto the ass!
  • 0
    @babeman I've already given hours and hours into 2 frameworks already...my brain will explode learning another in the current streak....😫
  • 1
    You had me at #FuckPHPInTheAss
  • 1
    I have succeeded......yessssssssss
  • 1
    Swift mailer have worked perfectly fine for my uses so far
  • 1
    @dextel2 I have stopped using any type of mail services unless I have a dedicated local server for it.
    I instead use SparkPost, or similar, that offers an API to send emails, so all you need is cURL
  • 1
    @Artemix for simple stuff he doesnt need laravel. Theres lumen. :)
  • 1
    Can we not do 4chan formatting in DevRant?
  • 0
    Thank you everyone for you inputs. :)

    @Artemix : That's a resourceful comment, I'll sure check it out soon.
    @ChainsawBaby : That is a sweet solution, I need to learn more in order to understand that
    @WorstVarNames : How many php frameworks are out there? I'll check out lumen :)
    @matthewp3247 : I know I know, but it's to unde rstant with 4chan formatting plus, it is easy to write it that way
  • 0
    @Artemix yup saw that.. infact I'm glad that I saw this now as in next semester they're teaching me 'Advanced PHP with WordPress and laravel framework' , I'm glad that I opted for Android
  • 0
    For the love of Linus! Start using Vagrant or Docker or what ever you feel like, but please replicate your server environoment localy!
  • 0
    @Artemix that's kind of the way docker works. It has no storage that won't be wiped (at least on default).
    I usually use Vagrant for my local dev stuff. Sure you could just spin up a VM by hand, but it simplyfies the process a lot.

    Btw. Docker is a great idea, but how it's implemented makes you cry from time to time.
  • 0
    @Artemix that indeed shouldn't happen. Where you able to just rebuild the images and continue, where you left off?
  • 0
    Hey, guys, I'm facing this bug on this same code. SO Question Link : https://stackoverflow.com/questions...

    It'd be really help for a brief answer.
  • 0
    @Artemix wtf? I'm sorry to hear. Good luck fixing that!
  • 1
    @dextel2 the solution on SO is quite okay in my opinion.
    1) Check if the request is a POST instead of a get request.
    2) check if all the mandatory fields are set (for example use `!empty($x)` and make sure, the reply address is an email address have a look at `filter_var`
    3) add a CSRF token.
  • 0
    @Wack thank you wack, I put empty() with conditions and now no Null emails in the inbox...I think I can sleep now..
  • 1
    @Artemix lots of love for the "Null coalescing operator"! @dextel2 take a look here http://php.net/manual/en/...
Add Comment