Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Creating a form that sends an email to inputted emails

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Creating a form that sends an email to inputted emails

Postby wbjtk » Sun Nov 18, 2012 9:22 pm

I am looking for some help on a small project for my site.
I haven't created anything yet but what I would like is a simple email form (which I could create)
But I would like it to have a section with 10 lines where you can input 10 email addresses.
Upon entering the emails, once submitted, it would send them a pre-designed email, inputting informations put into the form initially.

For example:

It could be a party invitation
You fill in host name, date of even, time, place, and 10 email addresses
It sends a pre-designed "invitation" to the 10 email recipients, inserting the host name, date, time etc in the email body where i would preset it to go.

Is this simple? Or is it difficult, requiring mysql etc.
Can anyone point me in the right direction?

Thanks!
wbjtk
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Nov 18, 2012 9:15 pm

Re: Creating a form that sends an email to inputted emails

Postby seandisanti » Mon Nov 19, 2012 10:21 am

It's simple, and you don't need 10 inputs. just have one and have them separate with a semicolon or whatever. Explode out the string to get an array of recipients and proceed with mail().
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 787
Joined: Mon Oct 01, 2012 12:32 pm

Re: Creating a form that sends an email to inputted emails

Postby wbjtk » Mon Nov 19, 2012 11:02 am

The thing is, I want to have 10 lines, so they can be inputted... this would be a form that could be filled out many times, with different addresses

And sorry but im such a newbie that none of that made sense lol
Is it ok to ask for specifics? Hope thats not against the rules of the forum...

Thanks!
wbjtk
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Nov 18, 2012 9:15 pm

Re: Creating a form that sends an email to inputted emails

Postby seandisanti » Mon Nov 19, 2012 1:16 pm

no worries man. Explode creates an array from a delimited string. http://php.net/explode and mail http://php.net/mail lets you create and send mail. Also, any time you see or hear a function you're not familiar with, check out php.net/function where function is the name of the function. You'll typically see example usage, and user submitted comments at the bottom that can help understand errors or things to watch out for.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 787
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.