VERY URGENT...............
Moderator: General Moderators
VERY URGENT...............
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
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
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.
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.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
patrikG | Please use
Waiting for your valuable replies..............
Thanks and regards
MADHU
patrikG | Please use
Code: Select all
,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]Thanks and regards
MADHU
patrikG | Please use
Code: Select all
,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]check the extra header section:
http://in.php.net/function.mail
http://in.php.net/function.mail
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Code: Select all
explode(', ', $emails); // string to array
implode(', ', $emails); // array to stringpatrikG | Please use
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
,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
,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]- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Last edited by Ollie Saunders on Tue Oct 10, 2006 9:06 am, edited 3 times in total.
madhu, please use
Code: Select all
tags (or other relevant tags such asCode: Select all
etc.) as explained here (click)[/url].patrikG | Please use
Kindly please do the needful..........
Waiting for your positive replies...........
Thanks and regards
MADHU
patrikG | Please use
Code: Select all
,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
,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]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.
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.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK