Jump to content

HELP! in sending emails PHP


yashbhav

Recommended Posts

Hi guys,

 

I am using following code for sending out confirmation email after successful transaction to the user. But, I users are not getting any confirmation emails. Can somebody help me out here. May be I am doing wrong in "$to" function as $sender_email is at previous form, So how can I use Session here? If I am wrong here?

Any someone help? Many Thanks in advance. :)

 

$to = "$sender_email";

$subject = "Your Transaction";

 

$headers = "From: Company <company@abc.com>\n";

$headers .= "Reply-To: Company <company@abc.com>\n";

$headers .= "MIME-Version: 1.0\n";

$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";

$message = "Dear ".$rs["sender_name"].", ".$_email_nl.$_email_nl;

$message .= "Your paid amount ".$amount." ".$rs["currency"]." has been added to desired account.".$_email_nl.$_email_nl;

$message .= "Regards,";

$message .= "my company";

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

Link to comment
Share on other sites

Hi ym_chaitu,

 

thanks for your reply. Yes, it is open and I also checked with sending test email with normal code. But, this code not working for me. Should I try something like this with help of sessions?

 

$email = $_SESSION["sender_email"];

$to = "$email";

........

.......

Link to comment
Share on other sites

try to echo the values what u are getting for the $to and so on and check it out..

 

 

Hi ym_chaitu,

 

thanks for your reply. Yes, it is open and I also checked with sending test email with normal code. But, this code not working for me. Should I try something like this with help of sessions?

 

$email = $_SESSION["sender_email"];

$to = "$email";

........

.......

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.