So I have a localhost WordPress server, and the function wp_mail workd perfectly and sends. When I put the exact same file in an actual WordPress website as a theme, it only shows me a blank screen, and doesn't send anything. Code:
<?php
if (isset($_POST['submit'])) {
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$company = $_POST['company'];
$to = "[email protected]";
function wpse27856_set_content_type(){
return "text/html";
}
add_filter( 'wp_mail_content_type','wpse27856_set_content_type' );
$msg = '<html><body><h1>Contact Service</h1><table rules="all" style="border-color: #666;" cellpadding="10"><tr style="background: #E3E8EC;"><td><strong>First Name:</strong> </td><td>' . strip_tags($_POST['first_name']) . '</td></tr><tr><td><strong>Last Name:</strong> </td><td>' . strip_tags($_POST['last_name']) . '</td></tr><tr><td><strong>Email:</strong> </td><td>' . strip_tags($_POST['email']) . '</td></tr><tr><td><strong>Company:</strong> </td><td>' . strip_tags($_POST['company']) . '</td></tr><tr><td><strong>Message:</strong> </td><td>' . strip_tags($_POST['message']) . '</td></tr></body></html>';
wp_mail( $to, $subject, $msg );
?>
This is followed by a form where you input everything. Any help would be appreciated :)