/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] PHP Mail() Function vs PHPMailer

Hi, I have been using the php mail() function for all web forms on a website. I have learned about phpmailer and have a couple of questions that I hope someone can help answer. I have some knowledge of the mail() function but have not use phpmailer before.

  • 1.

    Is there anything bad about using php mail() function? (e.g. more vulnerable than phpmailer, etc)

  • 2.

    I need to have html content and inline images for the emails that goes to the user (e.g. send to a friend email) is phpmailer better than the mail() function?

  • 3.

    What is the advantages of phpmailer over mail() function?

  • 4.

    is phpmailer or swiftmail hard to learn compare to mail() function?

  • thanks.

    to post a comment
    PHP

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @gvreMar 02.2013 — Use swiftmailer. It is a very well-written library with many features and great documentation.
    Copy linkTweet thisAlerts:
    @NogDogMar 02.2013 — Swiftmailer and PHPMailer are probably the two most popular 3rd party mail packages for sending email from within PHP code. I use PHPMailer mainly because it's the one I know, but I know more than a couple people who prefer Swiftmailer -- but whichever you use will get the job done, I think.

    The advantage of using them over the native mail function is that they take care of a lot of the detailed grunt work so that you don't have to. They make it much easier to do things like sending HTML email (with plain text alternative content) and file attachments, sending via a separate SMTP account on another server, taking care of setting the right headers and dealing with basic email security concerns, and so forth. It's nothing you couldn't do yourself with built-in PHP -- after all, PHPMailer is nothing but a library of PHP code -- but unless you want to do all the work yourself as some sort of learning exercise, why bother? ?
    ×

    Success!

    Help @phpnewbie08 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.5,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...