I suggest you first of all to separate code from markup, especially dividing your executing file like the function support_form()
.
Next, please try to send email without form with hard coded message. It is possible you have mis-configuration on your server if you developing on local machine.
And finally, you should fill action
attribute for <form>
tag. And that must refer to the executable script. Otherwise it tries to execute you homepage where this code is absent. If you are not planning to separate your markup and code I suppose you should link your action to the file that contains this script. When that happens, your code
if ( isset($_POST["submit"])) {
do_action('my_phpmailer_example');
}
will execute.
Related Posts:
- How to set SMTP programmatically
- How to set up gmail SMTP in WordPress
- How to setup SMTP for only one specific wp_mail()
- WordPress doesn’t work properly with non standard domain names – PHPMailer fails when initialising
- wp mail smtp earlier version
- WordPress stops executing code after the require() method
- Are email addresses case sensitive?
- What is the difference between ports 465 and 587?
- SmtpException: Unable to read data from the transport connection: net_io_connectionclosed
- Python: What is the correct MIME type for attaching html file to email
- File attachment with PHPMailer
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- How to send to BCC address when using PHPMailer to format MIME message for Gmail API?
- PhpMailer SMTP NOTICE: EOF caught while checking if connected
- PhpMailer SMTP NOTICE: EOF caught while checking if connected
- The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required?
- SMTP AUTH extension not supported by server
- AttributeError: ‘Series’ object has no attribute ‘split’ error in sending emails
- Page returns 404 with POST variables, but not without
- Why “Contact Form 7” doesn’t update PHPmailer library?
- WordPress “phpmailer_init” not working for me
- Using SMTP for outgoing mails (PHPMailer) on AWS instance?
- How to use PHPmailer in a function in WordPress
- Safe to store SMTP password in wp-config.php?
- How to Configure SMTP on wordpress Cant Send Email
- Contact Form 7 + Configure SMTP: Sender email appearing as my own email [closed]
- Should I use wp_mail or PHP’s mail? [duplicate]
- How to use ‘phpmailer_init’ SMTP settings only on certain ‘wp_mail’ actions?
- Error when requesting password reset email – wp authentication
- Send emails with wp_mail() using SMTP configured in plugin
- No longer able to attach S3 bucket files to emails being sent by WordPress due to PHPMailer security update
- User invite email not delivered – related to subdomain?
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- Setting Custom Email From name and email address in wp_email()
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response
- How can I use get_bloginfo(‘admin_email’) in a custom PHP file?
- How Can I Change Default Reply ToEmail
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- WordPress ‘on behalf of’ email
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- How to configure two SMTP Server for wordpress
- Redirect to another page after submission using wp_mail
- Email Bounce Address
- WP mail sent to MS Exchange recipients = occasional email corruption?
- WordPress unable to send mail
- SMTP Issues with Office 365
- Emailing passwords: Setup installed on home server using XAMPP
- Google Apps SMTP for WP MultiSite?
- wp_mail not sending emails
- Contact Form 7 not sending emails- no confirmation, no error [closed]
- Using WP_Mail on MacOS 12 (Monterey – M1) [closed]
- How dynamically change wp_mail behaviour, sending html or plain text based on conditions?
- WordPress SMTP EMail
- Is Postfix required for WordPress contact forms in general?
- Why is wp-login trying to send an email?
- wp_mail not sending email on custom function
- SMTP Error: Could not authenticate [closed]
- How can I configure an SMTP Server?
- Easy WP SMTP plugin test email failed
- Getting 400 Error: redirect_uri_mismatch when trying to grant permission to Gmail SMTP plugin
- What is the way to hook all wordpress email
- Different SMTP based on domain
- How can I format email notification after registration?
- how wordpress smtp works? my emailing is not working
- phpmailer reply to message id using AddCustomHeader
- Mailing issues with wordpress?
- Using SMTP Function instead of Plugin (functions.php)
- Submitting product attributes via Ninja Forms wordpress?
- Is it secure to use SMTP password in .php file in WordPress website?
- SMTP emails not picking up the correct From name and From email
- Running SMTP Conditionally
- Send email using wordpress plugin on behalf of someone with their permission
- WordPress wp_mail function crashing website
- How to properly use AWS SES for a contact form?
- WP Mail plugin not sending the mail
- phpmailer_init ignored on REST calls
- can’t submit mail from contact 7 form site using wp mail smtp
- Multisite – SMTP not working on other network sites
- SMTP not working for Comments Email Notifications
- PHPMailer – Uploading a file
- WP_mail() Issue. Duplicate emails if $_GET[‘A’] == email
- SMTP connect() failed
- WordPress doesn’t send SMTP email even by phpmailer hook
- How to make mailing queue using php’s mail() function
- Sending SMTP mail using a server with self-signed SSL
- Email Piping using google apps within WP Engine
- Change wp_mail SMTP settings for each E-Mail
- Call to undefined function _deprecated_file() in class-smtp.php
- Choose from different emails for different purposes
- FromName –> ReplyTo Name wordpress multisite contact form
- What ports to open for mail server?
- Do SPF Records For Primary Domain apply to subdomains?
- Post SMTP: Fatal error: Allowed memory size … exhausted
- Run PHPMailer function after ajax function completes that adds row to custom table