PhP mail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shuhail
Forum Newbie
Posts: 16
Joined: Sun Jun 28, 2009 5:52 am

PhP mail()

Post 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.
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Re: PhP mail()

Post 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
shuhail
Forum Newbie
Posts: 16
Joined: Sun Jun 28, 2009 5:52 am

Re: PhP mail()

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PhP mail()

Post 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.
shuhail
Forum Newbie
Posts: 16
Joined: Sun Jun 28, 2009 5:52 am

Re: PhP mail()

Post 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?
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: PhP mail()

Post 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);
 
Last edited by Benjamin on Tue Jun 30, 2009 12:03 am, edited 1 time in total.
Reason: Changed code type from text to php.
shuhail
Forum Newbie
Posts: 16
Joined: Sun Jun 28, 2009 5:52 am

Re: PhP mail()

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: PhP mail()

Post by Benjamin »

It is.
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: PhP mail()

Post 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 :drunk:
danielrs1
Forum Commoner
Posts: 29
Joined: Wed Jun 24, 2009 5:30 pm

Re: PhP mail()

Post 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);
}
 
Post Reply