Web code to send an email
Author
Discussion

KingAwesome

Original Poster:

5 posts

68 months

Tuesday 23rd March 2021
quotequote all
Hi all,

Been struggling to find the answer online, but i need a simple online form that sends an email to someone. The difference to a standard form is that i want someone to be able to type in the subject and message body, but also the email address they want it to be sent to, and the webpage will send an email from info@mywebsite.com

Any help would be greatly appreciated, cheers!

S13_Alan

1,393 posts

273 months

Tuesday 23rd March 2021
quotequote all
Web pages can't just send emails on their own and how you'd make it work depends on a bunch of things.

Do you know what technology it is that sits behind the page?

Is it a php thing like Wordpress or something?

essexd

65 posts

77 months

Tuesday 23rd March 2021
quotequote all
Do you want it hosted on your site, or on an external site?

Keep in mind room for abuse, if you're letting anyone use it to send random emails, it won't be long before you get blocked for spam by major email providers if it's found out.

KingAwesome

Original Poster:

5 posts

68 months

Tuesday 23rd March 2021
quotequote all
I'm absolutely flexible on the backend, if i need a specific requirement on the backend to get this working then I'll choose my hosting accordingly.

KingAwesome

Original Poster:

5 posts

68 months

Tuesday 23rd March 2021
quotequote all
aware of the abuse thing, and the potential for spam from the form, but hopefully other restrictions around the site will alleviate that problem.

essexd

65 posts

77 months

Tuesday 23rd March 2021
quotequote all
Do you have any experience in PHP or other server side languages or would you need someone to do it for you?

Akiraprise

271 posts

218 months

Tuesday 23rd March 2021
quotequote all
Something like Wordpress with "Contact Form 7" could do this easily,

But as mentioned there's a high chance these emails would end up in a user's spam folder so might be worth using alongside a mail delivery platform like Sendgrid

KingAwesome

Original Poster:

5 posts

68 months

Tuesday 23rd March 2021
quotequote all
Not a vast amount of experience, i can usually cobble stuff together but think this might be out of my reach without solid instruction... having someone do it would be the obviously easier answer but theres obvious costs to that i might not be able to afford

essexd

65 posts

77 months

Tuesday 23rd March 2021
quotequote all
What is your site running off already? If it's just a html website, you could use a normal HTML form, some PHP to check it over and something like PHPMailer, or sendgrid/mailgun to send it.

KingAwesome

Original Poster:

5 posts

68 months

Tuesday 23rd March 2021
quotequote all
i have no existing site. I have another website that i can upload stuff to to test it, but will be on a new standalone site when done so the backend can be whatever it needs to be.

akirk

5,778 posts

144 months

Tuesday 23rd March 2021
quotequote all
what could possibly go wrong ?! biggrin

wordpress with plugins as suggested above is one idea
phpmailer is a mailing library of code for php which is flexible and powerful to do what you need...

be aware of setting up the dns for your domain correctly... to authorise the website to send out as you...
you may want to add recaptcha or various other anti spam measures

biggest issue is that you may very rapidly be listed as a source of spam, many spammers now using humans to fill in forms... you will then be blacklisted...

it is probably not a lot of work for someone who knows what they are doing...

essexd

65 posts

77 months

Tuesday 23rd March 2021
quotequote all
KingAwesome said:
i have no existing site. I have another website that i can upload stuff to to test it, but will be on a new standalone site when done so the backend can be whatever it needs to be.
If you're wanting to do it yourself, Wordpress, but I'd recommend finding someone to do it for you.

babelfish

1,020 posts

237 months

Wednesday 24th March 2021
quotequote all
Google Form https://www.google.co.uk/forms/about/

Jot Forms https://www.jotform.com/

Just embed them in your web page using an iframe

threadlock

3,211 posts

284 months

Wednesday 24th March 2021
quotequote all
akirk said:
what could possibly go wrong ?! biggrin
hehe