Page 1 of 2
VERY URGENT...............
Posted: Tue Oct 10, 2006 2:51 am
by madhu
Dear All,
Am reading some mailid's from a text file and am storing in a variable.
$test=
a@gmail.com b@yahoo.co.in c@yahoo.co.in d@gmail.com
Now my problem is i want those mailid's in the form of comma
(,) seperated mailid's.
i.e,
$test=
a@gmail.com,
b@yahoo.co.in,
c@yahoo.co.in,
d@gmail.com
Its very urgent.
Please suggest me ..........
Thanks and regards
MADHU
Posted: Tue Oct 10, 2006 3:06 am
by timvw
You could show us what you've tried already...
Posted: Tue Oct 10, 2006 3:07 am
by Oren
How exactly they are stored in the file?
You may want to check
file().
P.S
Don't use the word "urgent" in your post/title since people will automatically skip to the next post. This is the first time I reply to a post with the word "urgent" in its title.
Posted: Tue Oct 10, 2006 3:09 am
by patrikG
Posted: Tue Oct 10, 2006 3:20 am
by Chris Corbyn
Urgent?

That's probably the worst way to gather interest for useful responses. For example; I've only open the thread to skim through in case it really was urgent only to now find myself acting as thread title critic.
Posted: Tue Oct 10, 2006 4:12 am
by madhu
patrikG | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Dear All,
Am really sorry.
Please excuse me.
Here is my code.
Code: Select all
$filename = "bcc/" . $_FILES['bccpath']['name']; //contains all mailid's
$fp=fopen($filename,"rb");
if($fp)
{
while (!feof($fp))
{
$bccemails=fgets($fp, 4096);
$bccemails=$bccemails.','; // it contains all mailid's with ',' seperated.
}
}[/b]
Now am trying to send that $bccemails as Bcc. But how to add that word as $bccemails "Bcc" to the mail function.
[b]if(mail($toid , $subject, $message, $bccemails))
{
echo "<html><body>";
print "success.............";
echo ("</body></html>");
}[/b]
Waiting for your valuable replies..............
Thanks and regards
MADHU
patrikG | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Posted: Tue Oct 10, 2006 4:36 am
by jito
check the extra header section:
http://in.php.net/function.mail
Posted: Tue Oct 10, 2006 6:22 am
by Ollie Saunders
Code: Select all
explode(', ', $emails); // string to array
implode(', ', $emails); // array to string
Posted: Tue Oct 10, 2006 9:00 am
by madhu
patrikG | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi all ,
Finally after struggling i got some output.
But again i have some problem.
Please check my code.........
Code: Select all
$filename = "bcc/" . $_FILES['bccpath']['name'];
$fp=fopen($filename,"rb"); //to open the file
$bccemails=file($filename); //to get as an array
foreach($bccemails as $bccemail)
{
$headers.= "$bccemail" . ", "; //',' separated
}
$headers = "Bcc: $headers\r\n";
if(mail($toid , $subject, $message, $from.$headers)) // to send mail as Bcc
{
echo "success.............";
}
Now problem is mail is not going to the mailid's which are in Bcc.
I think i did some small mistake.
Please check and help me.........
Waiting for your positive replies..........
Thanks and regards
MADHU
patrikG | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Posted: Tue Oct 10, 2006 9:04 am
by Ollie Saunders
if ($noPhpTags == FORM_BAD)
use
Posted: Tue Oct 10, 2006 9:05 am
by madhu
The Bcc mailid's are printing along with the Message........................
Please help me.........
Thanks and Regards
MADHU[/i]
Posted: Tue Oct 10, 2006 9:05 am
by patrikG
madhu,
please use Code: Select all
tags (or other relevant tags such as
Code: Select all
etc.) as explained here (click)[/url].
Posted: Tue Oct 10, 2006 9:11 am
by madhu
patrikG | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi all,
Am sorry , because am in urgent , so i posted that code without keeping the php tags.
Here is my code with PHP tags.
Please check..............
Code: Select all
<?php
$filename = "bcc/" . $_FILES['bccpath']['name'];
$fp=fopen($filename,"rb"); //to open the file
$bccemails=file($filename); //to get as an array
foreach($bccemails as $bccemail)
{
$headers.= "$bccemail" . ", "; //',' separated
}
$headers = "Bcc: $headers\r\n";
if(mail($toid , $subject, $message, $from.$headers)) // to send mail as Bcc
{
echo "success.............";
}
?>
Kindly please do the needful..........
Waiting for your positive replies...........
Thanks and regards
MADHU
patrikG | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Posted: Tue Oct 10, 2006 9:16 am
by patrikG
Mahdu, consider this an official warning: either you use PHP-tags when you post here, or your posting rights might be temporarily suspended.
Think about it this way: you are asking others to help you. The least you can do is ensure that you are doing everything you can to make it as easy as possible for them.
Posted: Tue Oct 10, 2006 9:24 am
by Ollie Saunders
patrikG: he thinks we mean <?php tags.
We mean bbCode