Way to read e-mail addresses Out Look Express

General discussions related to php

Moderators: macek, egami, gesf

vikaspa
New php-forum User
New php-forum User
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

Way to read e-mail addresses Out Look Express

Postby vikaspa » Tue Sep 17, 2002 2:19 am

Can you help me how to read email addresses from outlook express (from local hard disk)

It will be great if you help me to read e-mail addresses from and folders (of outlook Express) like Send, input, output etc)..


I am always gewtting tiimely help from you


With databases it Ok but i dont know how to do the it with out look express .

Jay

Postby Jay » Tue Sep 17, 2002 3:50 am

OE stores the emails in mbx files, so you'll have to search for them (they're all in one folder, dependant on your OS). Anyway, you will have to read the file and delimit each email. Then you'll have to run a regular expression to sift out all the emails. Once you've got them, you can do as you wish with them!

vikaspa
New php-forum User
New php-forum User
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

Still cannot get e-mail addreses from ".dbx" file

Postby vikaspa » Wed Sep 18, 2002 9:46 am

I open this dbx file (the file names has extention dbx)

Send Item.dbx
Outpput.dbx etc.

as mentioned by you.

I am reading character by character and looking for space , tab and coma as deliminater still what I am reading is some junk whch does not make sense.

Please help

comple code is given below (asks for inout and seperatwes e-mail addreses from the file (delimited by comma, space and tax and cCRLF

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
if (isset($submit))
{
print"Submit action ********";
print "file name =$fn<br> **********<br>";
$fp = fopen ($fn , "r");
$size= filesize($fn);
print "file size= $size <br>";
while (!feof ($fp)) {
$buff = fgetc($fp);
$asci = chr($buff);
$bx = $bin2hex($buff);
print "Bin2Hex : $bx $buf";
print "asci = $asci $buff <br>;";
if ($buff=="\t" or ($buff=="\n") or ($buff==" ") or ($buff==","))
{
// print "There is tab / crlf or space here<br>";
print "<br>String formed **$mystring<br>";
$gid=0;
$cid=0;
$pos= strpos($mystring,'@') ;
print "<br> $pos [$mystring] <br>";
if ($pos==false)
{
print "invalid e-mail id ..record skipped <<$email>>";
}
else
{
$insertquery="insert into emailregister values ($cid,'$mystring',$gid,'$sdt','$stime')";
print "<br>$insertquery)";
$resultinsert=mysql_db_query("fafai",$insertquery);
if ($resultinsert= true)
{
print "Query Succeeded";
}
else
{
print "Query Failed";
}
}
$mystring="";
}
$mystring.=$buff;
}
fclose ($fp);
}
?>
<table width="779" border="1" cellspacing="1" cellpadding="2">
<!--DWLayoutTable-->
<form action="<?php $PHP_SELF ?>" method="post">
<tr>
<td width="65" height="32" valign="top">File Name *</td>
<td width="215" valign="top"><input type="text" name="fn" height="9" width="25"></td>
<td width="397" valign="top"><input name="submit" type="submit" value="Upload this file"></td>

</form>
<tr>
<td height="68">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>
</body>
</html>
Last edited by vikaspa on Wed Sep 18, 2002 9:57 am, edited 1 time in total.

vikaspa
New php-forum User
New php-forum User
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

Still cannot get e-mail addreses from ".dbx" file

Postby vikaspa » Wed Sep 18, 2002 9:47 am

I open this dbx file (the file names has extention dbx)

Send Item.dbx
Outpput.dbx etc.

as mentioned by you.

I am reading character by character and looking for space , tab and coma as deliminater still what I am reading is some junk whch does not make sense.

Please help

comple code is given below (asks for inout and seperatwes e-mail addreses from the file (delimited by comma, space and tax and cCRLF


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
print $isset;
print $fn;
if (isset($submit))
{
print"Submit action ********";
print "file name =$fn<br> **********<br>";
$fp = fopen ($fn , "r");
$size= filesize($fn);
print "file size= $size <br>";
while (!feof ($fp)) {
$buff = fgetc($fp);
//i tried even to read the juch using these convergence functions
$asci = chr($buff);
$bx = $bin2hex($buff);
print "Bin2Hex : $bx $buf";
print "asci = $asci $buff <br>;";
//end of convergence functions
if ($buff=="\t" or ($buff=="\n") or ($buff==" ") or ($buff==","))
{
// print "There is tab / crlf or space here<br>";
print "<br>String formed **$mystring<br>";
$gid=0;
$cid=0;
$pos= strpos($mystring,'@') ;
print "<br> $pos [$mystring] <br>";
if ($pos==false)
{
print "invalid e-mail id ..record skipped <<$email>>";
}
else
{
$insertquery="insert into emailregister values ($cid,'$mystring',$gid,'$sdt','$stime')";
print "<br>$insertquery)";
$resultinsert=mysql_db_query("fafai",$insertquery);
if ($resultinsert= true)
{
print "Query Succeeded";
}
else
{
print "Query Failed";
}
}
$mystring="";
}
$mystring.=$buff;
}
fclose ($fp);
}
?>
<table width="779" border="1" cellspacing="1" cellpadding="2">
<!--DWLayoutTable-->
<form action="<?php $PHP_SELF ?>" method="post">
<tr>
<td width="65" height="32" valign="top">File Name *</td>
<td width="215" valign="top"><input type="text" name="fn" height="9" width="25"></td>
<td width="397" valign="top"><input name="submit" type="submit" value="Upload this file"></td>

</form>
<tr>
<td height="68">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>
</body>
</html>

Jay

Postby Jay » Wed Sep 18, 2002 11:16 am

What you want is to read each separate item and determine if it's an email address or not, and skip if it isn't! I'm sorry but I really haven't got the patience to read through your script without more info

vikaspa
New php-forum User
New php-forum User
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

I know you dont have patience

Postby vikaspa » Wed Sep 18, 2002 12:29 pm

I am aware that you donot have poatience to read the code,

Ny point is when I try to read this OE file as sequential file, I am getting lot of spcial characters (squares and funny charatcters) acould not read a single e-mail id...

I tries to convert the charatcter to ASCII or to Hex but couldnot succeeded in geting w- W-Mail ID.

Jay

Postby Jay » Wed Sep 18, 2002 2:23 pm

That's the encryption in OE for you ;)


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron