Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7533591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:46:07+00:00 2026-05-30T05:46:07+00:00

I’m creating a page with 4 buttons (the buttons will be 4 different images),

  • 0

I’m creating a page with 4 buttons (the buttons will be 4 different images), so when you press any one of the buttons, an email is sent to the appropriate department.

For example, button 1 is for Math department, when you press button 1, an email is sent automatically to math@uni.com, press button 2, an email is automatically sent to music@uni.com and so on.

This project will be using a subdomain on my work’s website eg xxx.ourcompany.com How can I send an email automatically with a click of one of the four buttons using html, php or javascript if necessary?

(Ignore below if you have better ideas on how to do the task above, or it would be great if you could help me on the below issue) this is what I’ve found so far:

I saw a post that someone suggested the code below. I tried to duplicate the code for four buttons, but the email can’t be sent to every mail address from the subdomain (xxx.ourcompany.com).

Issue: The only email address is receiving the notification is an email address with our company’s name in it eg name@ourcompany.com but not yahoo or gmail account. I’m not sure what the reason is? Also what is a good way to stop spam as well? Your help is really appreciated.

<form action="" method="post">
<input type="submit" value="Send details to A" />
<input type="hidden" name="button_a" value="1" />
</form>

<?php

if(isset($_POST['button_a']))
{

$to      = 'name@ourcompany.com'; //can receive notification

$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@ourcompany.com' . "\r\n" .
    'Reply-To: webmaster@ourcompany.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

echo 'Email Sent.';
}

?>

I duplicate the code for the second button, but the yahoo or gmail email address can’t receive notification

<form action="" method="post">
<input type="submit" value="Send details to B" />
<input type="hidden" name="button_b" value="1" />
</form>

<?php

if(isset($_POST['button_b']))
{

$to      = 'name@yahoo.com'; //can't receive notification!

$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@ourcompany.com' . "\r\n" .
    'Reply-To: webmaster@ourcompany.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

echo 'Email Sent.';
}

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:46:09+00:00Added an answer on May 30, 2026 at 5:46 am

    First of all, your emails are considered spam. Web mail providers like Gmail and Yahoo only receive email if they think the source is trustworthy. i get that a lot of times, when a co-worker emails me to my personal email using his company email. it always ends up in the spam.

    and consider that your page is online, anyone can hack into it, and send spam all over your company using those one-click emailers you’re trying to create.

    how about concentrating on building sort of inter-department messaging system. you’d have to enforce the departments to subscribe to this, maybe build a desktop app or web app for it so they see the messages easily. it’s better this way, sort of an “in-house twitter”.

    or use twitter instead! 😀

    or, i think this is possible, use an email client, and one company email. i think email clients today have “templates”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I need a function that will clean a strings' special characters. I do NOT
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.