not send link in mail using php - php

I want to send confirmation link to new users. I used this code to send mail (confirmation link)
$to = $email;
$subject = "Verify Your Account";
$actual_link = "http://myorchidkart.com/simplepay/verify_email.php?hash=" . $hash;
$message = "<a href ='".$actual_link."'>" . $actual_link . "</a>";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: ". $from. "\r\n";
$headers .= "Reply-To: ". $from. "\r\n";
mail($to, $subject, $message, $headers);
but there is no confirmation link, only text but no link
how can I solve this ...?
mail is look like this
enter image description here

Related

Want to put button instead of link in mail

I want to convert the link to the button in PHP mail.php file.
$message = sprintf($this->language->get('mail_message'), $store_name, $link);
I will appreciate if someone helps me to convert the link to the button.
To achieve this, you have to send html email instead of plain/text email. It is pretty simple, leave the images on the server and send the PHP + CSS to them...
$to = 'xyz#example.com';
$subject = 'Subject';
$headers = "From: " . strip_tags($_POST['req-email']) . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "\r\n";
$headers .= "CC: abc#example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$message = '<p>Anchor Text</p>';
mail($to, $subject, $message, $headers);

How to check if mail was send or not using php?

How to check if mail was send or not using php ?
I use this code for send email using php. It's work good.
But i want to check email send success or not, How can i do that ?
<?PHP
$to = "test#mail.com";
$subject = "test subject";
$message = "test message";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: SENDER <noreply#sender.com>' . "\r\n";
$headers .= 'Return-Path: return#sender.com' . "\r\n";
mail($to, $subject, $message, $headers, '-freturn#sender.com');
?>

how to change the from attribute to my email in mail() function

I am trying to send an email to my customers when they place an order on my website. But the from appears like this:
From : n9da2313
I need to exchange it with info#awraq.me
I tried this but didn't work
`
$to = "founder#awraq.me";
$subject = "Your order";
$message = "Your order was placed successfuly";
$headers = "From: info#awraq.me";
$headers .= "\r\nReply-To: info#awraq.me";
$headers .= "\r\nX-Mailer: PHP/".phpversion();
mail($to,$subject,$message,$headers,"-f info#awraq.me");
`
try this-
$to = "somebody#example.com, somebodyelse#example.com";
$subject = "HTML email";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <webmaster#example.com>' . "\r\n";
$headers .= 'Cc: myboss#example.com' . "\r\n";
mail($to,$subject,$message,$headers);
If its not working then check if you have done some configuration in php.ini file.

PHP mail displaying content type header inside the body

I'm making a form, when it submits it sends you a HTML email with a confirmation that you submitted it correctly.
When I receive the email; the content type header is inside the body of the email and the HTML code is displaying as raw text.
Screenshot:
Here is my code:
$to = 'myemail#gmail.com';
$subject = "HTML email";
$body = "<html><body><h1>Hello world!</h1></body></html>";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: <webmaster#website.com/>' . "\r\n";
mail($to, $subject, $body, $headers);
Could anyone please tell me what exactly is going wrong?
Thank you
Change your below three lines
From
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: <webmaster#website.com/>' . "\r\n";
To
$headers = "MIME-Version: 1.0" . PHP_EOL;
$headers .= "Content-type:text/html;charset=iso-8859-1" . PHP_EOL;
$headers .= 'From: <webmaster#website.com/>' . PHP_EOL;
I think after that this will work properly

Changing header "From: noreply#domain.com" to other value, sends mail into spam folder

I have this php mail() code on my site, which works fine.
It is an ecard system, my client can fill out the from info (name, email) and to info (name, email), etc and Mail goes straight to Inbox, on google, hotmail, yahoo, etc.
When the receiver gets the email he can use the reply button, and it gets the right info.
The problem is the From: header in my mail form, I want to change this from noreply#example.com to the receiver's info, or any other info. When I do that, the mail goes into SPAM mail.
Here is the code I'm using
<?php
$name = $_REQUEST['name'] ;
$motive = $_REQUEST['email'] ;
$name2 = $_REQUEST['name2'] ;
$email2 = $_REQUEST['email2'] ;
$message = $_REQUEST['message'] ;
$subject = $_REQUEST['subject'] ;
$message = urldecode(stripslashes($message));
$headers = 'From:' . $name . ' John Q<noreply#example.com>' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers.= "Reply-To:" .$name. "<" . $motive. ">\n";
$headers.= "Return-Path: My Company<admin#datatopixels.com>\n";
$headers.= "X-Mailer: PHP". phpversion() ."\n";
$messagee = "
<html>
<head>
<title>Title here</title>
</head>
<body>
<center>
<br>
</center>
</body>
</html>
";
mail($to, $subject, $messagee, $headers);
?>
You must to add a needle headers:
Sample code :
$headers = "From: myplace#example.com\r\n";
$headers .= "Reply-To: myplace2#example.com\r\n";
$headers .= "Return-Path: myplace#example.com\r\n";
$headers .= "CC: sombodyelse#example.com\r\n";
$headers .= "BCC: hidden#example.com\r\n";
if ( mail($to,$subject,$message,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
And I would suggest to read oswalds's

Categories