Mail Receiving form root@localhost
-
If click on get quote, mail should go for admin with from mail id. mail going to admin but from mail is like “[email protected]
“. This is my code:
`<?php
add_filter(‘woocommerce_get_price_html’, ‘requestQuote’, 10, 2);function requestQuote($price, $product) {
if ( $price == wc_price( 0.00 ) ){
$current_user = wp_get_current_user();
remove_action( ‘woocommerce_single_product_summary’,
‘woocommerce_template_single_add_to_cart’, 30 );
echo'<form action=”” method=”post”>’;?><input type=”hidden” name=”pn” value=”<?php echo the_title();?>”><?
echo ‘<input type=”hidden” name=”from” value=’.$current_user->user_email.’”>’;
echo ‘<input type=”submit” name=”send” value=”Get Quote”></form>’;}
else{
return $price;
}
}if($_POST[‘send’]) {
$to= get_bloginfo(‘admin_email’);
$from = $_POST[‘from’];
$product_name=$_POST[‘pn’];
$subject = ‘New Request For Quotation’;
$body = ‘Please send price for ‘.$product_name;$headers = “From: ” . $from . “\r\n”;
wp_mail( $to,$subject, $body, $headers );
}
The page I need help with: [log in to see the link]
- The topic ‘Mail Receiving form root@localhost’ is closed to new replies.