Jump to content
Sign in to follow this  
AARRGGHHH

Advice Needed for Basic, Simple PHP Mail Script

Recommended Posts

It's been a long time since that PHP class in college, and the majority of my focus since graduating has been on HTML5 / CSS3 / JavaScript.  I'm getting ready to go live with a new website.  I have a contact form build with HTML5 and CSS3 with validation done with JavaScript.  The only problem is, I'll need a PHP script to send the form via email. 

Is there a basic, easy to use script that someone could recommend?  Also, is it possible that my web host (I'll possibly be going with Go Daddy) will make such a script available?   I'm hoping to find something that's essentially plug and play. 

Thank you  

Share this post


Link to post
Share on other sites

If your web host has sendmail enabled, the simplest way to send e-mails is to use the mail() function. All you need to do is pass a few strings into one function to use it. It is very primitive and doing things like attaching files or sending formatted e-mails is difficult.

The PHPMailer library is much more flexible and has many more features. It requires more code to start off, but overall it makes attaching files, sending mail through an SMTP server and formatting mail with HTML much simpler than with the mail() function.

 

 

 

Share this post


Link to post
Share on other sites

In regard to formatted emails, can mail() do basic formatting such as line breaks? I'm not looking for attachments and colors and font selection at the moment, as long as everything isn't run together as one long string with no line breaks I'll be happy. 

Also, any suggestions as to a host would be welcomed.  Does that issue still exist where it takes a couple days for the IP address to propagate once it is assigned to a web host? 

Thank you very much  

Edited by AARRGGHHH

Share this post


Link to post
Share on other sites

The mail() function works with line breaks. Just put a line break in the message that you're sending.

It will take a day or two for a domain name to be assigned to an IP address. That's not an issue, that's just the nature of the internet. It takes time for the millions of DNS servers across the world to update their records when a domain name has been assigned to a new IP address.

Share this post


Link to post
Share on other sites

PS: Regarding "It will take a day or two for a domain name to be assigned to an IP address."

Go Daddy already has a parking page at the URL.  Does this mean that the DNS Servers/IP Address concern is resolved as long as I stay with Go Daddy? 

Thank again!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×