Page 1 of 1
PhP mail()
Posted: Sun Jun 28, 2009 8:55 am
by shuhail
Hey guys,
i m new here.
3days ago i got a mail in my inbox including these two lines at footer:
"This email was sent to '
shuhail@somthing.com' with Member ID shuhail.
You are receiving this email because you are a registered member of something"
now, i need to know the php code to find out recipient mail address [I mean "This email was sent to: ?"]
the code to find out who is recieving the email... Thats all.
is that possible?
please help.
Re: PhP mail()
Posted: Sun Jun 28, 2009 9:56 am
by a94060
i dont think this relates to php. But see if you can find out the message headers,that should give you a clue to who may have sent it
Re: PhP mail()
Posted: Mon Jun 29, 2009 2:27 am
by shuhail
I m confused... the views of my post is increasing... but no solution...!!!
may be my question is not clear to the viewer.
once again:
I want to send you a email at
you@you.com ,
#################################
from:
me@me.com
To:
you@you.com
Subject: Testing
Hello YOU,
your email address is : you@you.com
#################################
so I need the php code to find out who is recieving the email.
Re: PhP mail()
Posted: Mon Jun 29, 2009 3:44 am
by requinix
shuhail wrote:I want to send you a email at
you@you.com ,
shuhail wrote:so I need the php code to find out who is recieving the email.
The person receiving the email is the person you sent it to. Duh.
Re: PhP mail()
Posted: Mon Jun 29, 2009 8:05 pm
by shuhail
i know that...
but is there any code that will genetare in the mail and show the reciver's email address within the mail?
Re: PhP mail()
Posted: Mon Jun 29, 2009 8:12 pm
by BornForCode
This may help you:
Code: Select all
<?php
$myemail = 'myemail@nothing.com';
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello my mail address is: '.$myemail;
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
Re: PhP mail()
Posted: Mon Jun 29, 2009 8:26 pm
by shuhail
its funny..... by the way thanks.
i am sending a mail to a lot of reciepent through bcc.
but i want their own name in the mail. but it seems impossible...
Thanks again.
Re: PhP mail()
Posted: Tue Jun 30, 2009 12:03 am
by Benjamin
It is.
Re: PhP mail()
Posted: Tue Jun 30, 2009 3:14 am
by BornForCode
If is not funny but you are still doing it than for sure you are on the wrong way. Life is to short to do what you don't like.
PS beer is good for my inner me, is revealing capabilities that i didn't know that i had

Re: PhP mail()
Posted: Tue Jun 30, 2009 4:40 am
by danielrs1
Try to use something like:
Code: Select all
$myemail = 'myemail@nothing.com';
$subject = 'the subject';
$message = 'hello my mail address is: '.$myemail;
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$mails = array('mail1@gmail.com','mail2@gmail.com','mail3@gmail.com','mail4@gmail.com');
foreach($mail as $value){
mail($value, $subject, $message, $headers);
}