Monday, September 25. 2006
Comments
Display comments as
(Linear | Threaded)
i used this but iget always kin the snapshot error libg110
Hi hamzah
I haven't studied the libgmailer class in a lot of detail but just taking a quick look now it looks like the error you are getting is caused by Gmail redirecting you to login screen.
I would assume this is caused by incorrect login information although I haven't tested whether this is true.
I haven't studied the libgmailer class in a lot of detail but just taking a quick look now it looks like the error you are getting is caused by Gmail redirecting you to login screen.
I would assume this is caused by incorrect login information although I haven't tested whether this is true.
Hello, i have a question how can i skip the choose_contacts step in order to send directly the emails when the user gives the information in the get_contact_details form, thanks!!
Hi OSCAR
The best thing to do would be to replace the content of the foreach statements in choose_contacts.php
So instead of
you would have
$subject = "Some subject.";
$message = "Hello Joe it's only me!";
$extra_header = "From: me@mydomain.com";
foreach($returned_emails as $row){
mail($row['0'], $subject, $message, $extra_header);
};
The best thing to do would be to replace the content of the foreach statements in choose_contacts.php
So instead of
foreach($returned_emails as $row){
echo "";
echo '';
echo ''.$row['0'].'';
echo ''.$row['1'].'';
echo "\n\n";
};
echo "";
echo '';
echo ''.$row['0'].'';
echo ''.$row['1'].'';
echo "\n\n";
};
you would have
$subject = "Some subject.";
$message = "Hello Joe it's only me!";
$extra_header = "From: me@mydomain.com";
foreach($returned_emails as $row){
mail($row['0'], $subject, $message, $extra_header);
};
ME AGAIN, ITS POSIBLE TO ADD A CODE TO CHANGE THE NICK OF THE USER? AND SAY MESSAGES TO THE CONTACTS ONLINE ?
THANKS!
THANKS!
Hi
Sorry for taking so long to approve your comment.
I've fairly extensively hacked the code so that it will get the contacts and essentially nothing else. The original script could send messages so you might want to look at the page for the original script - http://flumpcakes.co.uk/php/msn-messenger
Sorry for taking so long to approve your comment.
I've fairly extensively hacked the code so that it will get the contacts and essentially nothing else. The original script could send messages so you might want to look at the page for the original script - http://flumpcakes.co.uk/php/msn-messenger
Hi I have installed your program but i am having a problem with the connection. I have never can connect so after some time the program return this error:
Fail to connect because: no response
I am introduce good username and password
Could you help me
Fail to connect because: no response
I am introduce good username and password
Could you help me
Hi Luis
Which service are you having problems connecting with?
MSN or Gmail?
Which service are you having problems connecting with?
MSN or Gmail?
Great script!! never thought it could be possible:-)
Is it possible to grab ONLY the MSN contacts that are ONLINE??? Instead of grabbing them all even if they are offline..
Could you help me
Thanks!
Is it possible to grab ONLY the MSN contacts that are ONLINE??? Instead of grabbing them all even if they are offline..
Could you help me
Thanks!
Hi Chris
Information about which contacts are online must be provided but I'm not sure how you would access it.
If you turn debugging on in the script you'll get the raw output. There may be something in there of value. It's probably just an integer value or something very simple.
I don't have time just now to take a look but if I remember I'll see what I can do in the next few days.
Information about which contacts are online must be provided but I'm not sure how you would access it.
If you turn debugging on in the script you'll get the raw output. There may be something in there of value. It's probably just an integer value or something very simple.
I don't have time just now to take a look but if I remember I'll see what I can do in the next few days.
Hi,
I tested script today. it goes very well. But why the execution and the recovery of e-mail are so long (approximately 2 minutes)?
I tested script today. it goes very well. But why the execution and the recovery of e-mail are so long (approximately 2 minutes)?
Hi Maxime
For it to take so long is definitely strange. Does it take that long to get the MSN contacts or Gmail? Or is it both?
If it is taking that long to run I'm surprised you're not getting a max runtime exceeded error.
For it to take so long is definitely strange. Does it take that long to get the MSN contacts or Gmail? Or is it both?
If it is taking that long to run I'm surprised you're not getting a max runtime exceeded error.
I did not test for gmail, only for MSN, i am not getting a max runtime exceeded error.
After having clicked on “Get Contacts”, the results are posted at the end of 1m30/2min. Not less…
I don't understand... ^^
Sorry for my english but i'm not english
After having clicked on “Get Contacts”, the results are posted at the end of 1m30/2min. Not less…
I don't understand... ^^
Sorry for my english but i'm not english
That it is just MSN makes sense. To get the contacts there are several steps that must be gone through so it will take longer than your average page load. 2 minutes though is excessive.
You could try using the web service instead - http://torrentialwebdev.com/blog/archives/37-MSN-contact-grab-web-service-is-finally-up.html - but there are issues with that. Might be worth trying though to see if it is still taking as long. If it does still take ~2min then it will be a problem with the MSN service. If it is taking less then it would be something about your server.
I can take a look at it later today but I'm not sure there will be anything more I can suggest.
You could try using the web service instead - http://torrentialwebdev.com/blog/archives/37-MSN-contact-grab-web-service-is-finally-up.html - but there are issues with that. Might be worth trying though to see if it is still taking as long. If it does still take ~2min then it will be a problem with the MSN service. If it is taking less then it would be something about your server.
I can take a look at it later today but I'm not sure there will be anything more I can suggest.
In fact I found the problem, for an address “@hotmail.com” the service goes perfectly if not when the address is: “@hotmail.fr” or “@mydomain.com” (account passport) the access puts 1min30 at 2min
Oh that's very interesting. Thanks for tracking that down.
A couple of other people have noticed some problems with emails other than @hotmail.com so it is interesting that it doesn't fail completely but takes a very long time.
I'm going to look into this further.
Thanks.
A couple of other people have noticed some problems with emails other than @hotmail.com so it is interesting that it doesn't fail completely but takes a very long time.
I'm going to look into this further.
Thanks.
Hello,
I wanted to know if you had found a solution of the problem of execution of the program in the delay of 1min30/2min for addresses others than **** @hotmail.com?
Thanks!
I wanted to know if you had found a solution of the problem of execution of the program in the delay of 1min30/2min for addresses others than **** @hotmail.com?
Thanks!
I haven't had a chance to look yet. It is on my to-do list for this weekend.
Hi Maxime
I think I'm making progress with getting the script to work with non @hotmail.com addresses but I don't really have much to test it with.
If you would be willing it would be appreciated if you could give it a try before I actually release it.
If you contact me at jonathan at torrentialwebdev.com I'll send you the script.
I think I'm making progress with getting the script to work with non @hotmail.com addresses but I don't really have much to test it with.
If you would be willing it would be appreciated if you could give it a try before I actually release it.
If you contact me at jonathan at torrentialwebdev.com I'll send you the script.
ok I sent an email to you !
hello scripts work until i press send mail s, than i need to wait about 30 sec and then it shows just blank screen. please help me
Hi Omar
30 seconds is normally the default maximum execution time so it's likely that you are coming up against this.
How many emails are you attempting to send at a time? The mail function is know to be relatively inefficient but I would be surprised if it was a problem.
Are any emails being sent?
30 seconds is normally the default maximum execution time so it's likely that you are coming up against this.
How many emails are you attempting to send at a time? The mail function is know to be relatively inefficient but I would be surprised if it was a problem.
Are any emails being sent?
no i tried to send only 2-3 mails and nothing was sent, and then i tried to send on all addresses and nothing happened . you can see it on http://www.mahala.monoblue.org/msn/
and one more time , thank you very much for this script
and one more time , thank you very much for this script
I can't get it to show a blank screen. It comes up with 'mailovi poslani' which I assume is 'mail sent' but I haven't received any emails yet so it wouldn't seem to be working.
Have to tested to see whether you can ordinarily send email? If not then create a php file with the following in it
mail('you@yourhost.com', 'Test Subject', 'Test Message');
If you still don't receive anything then I would suspect that your host hasn't configured php to send email. If that works fine I'll take another/closer look.
Have to tested to see whether you can ordinarily send email? If not then create a php file with the following in it
mail('you@yourhost.com', 'Test Subject', 'Test Message');
If you still don't receive anything then I would suspect that your host hasn't configured php to send email. If that works fine I'll take another/closer look.
can't get the send_mail.php script to send any mails, and half of the times the script only returns in a "canno't display page" error message. Any ideas?
Hi grabber
You seem to be having the same trouble with emails as omar immediately above you in the comments.
If you try sending a test email with
mail('you@yourhost.com', 'Test Subject', 'Test Message');
and also edit the files to include the following at the top
error_reporting(E_ALL);
and then report back with the errors I'll better be able to help you.
You seem to be having the same trouble with emails as omar immediately above you in the comments.
If you try sending a test email with
mail('you@yourhost.com', 'Test Subject', 'Test Message');
and also edit the files to include the following at the top
error_reporting(E_ALL);
and then report back with the errors I'll better be able to help you.
This is really fantastic, I actually had to go get the libgmailer.php from sourceforge to get it to work, but otherwise great stuff.
I've spent a couple of unsuccessful hours trying to get the username into the send email script so that the "from" address is recognizable to the recipient.
Can you give any pointers about how that might be accomplished?
Thanks again for the script, it's awesome as is.
I've spent a couple of unsuccessful hours trying to get the username into the send email script so that the "from" address is recognizable to the recipient.
Can you give any pointers about how that might be accomplished?
Thanks again for the script, it's awesome as is.
Hi John
I seem to be having trouble using code in comments. I'll return to this later. Any difficulties following what is going on let me know.
Substitute < and > with their appropriate html entities
In choose_contacts.php find the following line
<input type="submit" value="Send Emails" />
and immediately before it put
<input type="hidden" name="user_email" value="<?php if($_POST['service'] == "msn") {print(htmlspecialchars($_POST['username']));}
else {print(htmlspecialchars($_POST['username']) . "@gmail.com");}
?>" />
that should pass the value to send_emails.php
For sending email with the from header see example 1067 on the mail manual page - http://uk2.php.net/manual/en/function.mail.php
Hope that helps.
As always though, any problems don't hesitate to get back in touch.
I seem to be having trouble using code in comments. I'll return to this later. Any difficulties following what is going on let me know.
Substitute < and > with their appropriate html entities
In choose_contacts.php find the following line
<input type="submit" value="Send Emails" />
and immediately before it put
<input type="hidden" name="user_email" value="<?php if($_POST['service'] == "msn") {print(htmlspecialchars($_POST['username']));}
else {print(htmlspecialchars($_POST['username']) . "@gmail.com");}
?>" />
that should pass the value to send_emails.php
For sending email with the from header see example 1067 on the mail manual page - http://uk2.php.net/manual/en/function.mail.php
Hope that helps.
As always though, any problems don't hesitate to get back in touch.
Hi,
Were is the code for msn_contact_grab.class.php and libgmailer.php am i just being blind cos i cant find them
Thanks in advanced
Joe

Were is the code for msn_contact_grab.class.php and libgmailer.php am i just being blind cos i cant find them
Thanks in advanced
Joe
Hi Joe
The msn_contact_grab class and the ligmailer file need to be obtained separately.
Links for each are hidden away in the final paragraph of the post.
http://jmstreet.info/archives/17-Grabbing-an-MSN-contact-list.html
http://jmstreet.info/archives/16-Grabbing-a-Gmail-contact-list.html
The msn_contact_grab class and the ligmailer file need to be obtained separately.
Links for each are hidden away in the final paragraph of the post.
http://jmstreet.info/archives/17-Grabbing-an-MSN-contact-list.html
http://jmstreet.info/archives/16-Grabbing-a-Gmail-contact-list.html
Installed the msn class and when i try to login i get "Could not connect to messenger service" is this a problem with my fsockopen.
you can test here you probley dont tho cos of the info you have to input
http://www.mediadump.co.uk/get_login_details.php
Thanks Joe
you can test here you probley dont tho cos of the info you have to input
http://www.mediadump.co.uk/get_login_details.php
Thanks Joe
fsockopen is the most likely candidate.
You'll need to speak with your host and see if you can get access.
Alternatively you could give the web service a try but there are privacy issues with that.
You'll need to speak with your host and see if you can get access.
Alternatively you could give the web service a try but there are privacy issues with that.
Msn script sometimes doesnt display contacts, I need to retry 2-3 times to make it work , click back and forth, do you know any possible reason for that
Hi, if you use an incorrect password it doesent say any error it just takes you to the page were it lists the contacts and just shows an empty list.
kromania, I've just released an improved version so I suggest you download the script again and see how it works for you. Still won't be 100% though. MSN seems to refuse to send the contacts every time. This is especially so if you have made several requests in a short time. I'm not really sure what I can do to solve that.
Joe, yep lack of feedback on errors is a major problem with this script. It was based on someone else's work and really needs to be completely re-written to suit our slightly different needs.
Joe, yep lack of feedback on errors is a major problem with this script. It was based on someone else's work and really needs to be completely re-written to suit our slightly different needs.
Hi again, I installed it and havent noticed a difference so far
Hi jonathan,
What way do you think i should go about making it check the emails with emails that are in a database and if they are it will disable the tick box so no email is sent out to that contact.
Thns in advanced
Joe
What way do you think i should go about making it check the emails with emails that are in a database and if they are it will disable the tick box so no email is sent out to that contact.
Thns in advanced
Joe
It's probably going to be less resource intensive if you aim to send just one query to the database. So instead of sending a short query for each email address I'd aim for something like:
SELECT id, email FROM users WHERE email = 'joe@home.net' OR 'peter@work.com' OR . . .
You'll then get back an array of all the emails of people who have already signed up. This is going to be shorter than the complete list so should be fairly quick to check back against the complete list of imports.
Having said this you'll still end up with a lot of nested loops. This approach will work well while very few of the returned contacts are already members. Once, you start to get a significant number showing up as already being members it may start to hurt. As is always the case when you're optimizing your code testing is vital.
However you do it don't forget to use an index on your email field.
SELECT id, email FROM users WHERE email = 'joe@home.net' OR 'peter@work.com' OR . . .
You'll then get back an array of all the emails of people who have already signed up. This is going to be shorter than the complete list so should be fairly quick to check back against the complete list of imports.
Having said this you'll still end up with a lot of nested loops. This approach will work well while very few of the returned contacts are already members. Once, you start to get a significant number showing up as already being members it may start to hurt. As is always the case when you're optimizing your code testing is vital.
However you do it don't forget to use an index on your email field.
Is there a way to modify the contact a contact list code to use the webservice?? I don't really need gmail so I can cut that code out, I just need the msn to connect through the webservice.
I think I made the interface for the web service wrapper class the same as the contact grab class so it should just be a case of including a different file and everything else should work just the same.
If collect the scripts into one pack would be much more better.
Is there a way we can send the emails through a smtp server?
Absolutely. I suggest you take a look at swiftmailer:
http://www.swiftmailer.org/
http://www.swiftmailer.org/
KK Thanks ill try that
I've tried quite a few things but nothing seems to work ill give that swift mailer a shot and see what happens
I've tried quite a few things but nothing seems to work ill give that swift mailer a shot and see what happens
Hi Jonathan, thanks for this scripts.
I have installed it but I need try 2 or 3 times to grab MSN contacts.
When I click on Send Emails button, I have a blank page.
I have host on Dreamhost
I have installed it but I need try 2 or 3 times to grab MSN contacts.
When I click on Send Emails button, I have a blank page.
I have host on Dreamhost
Hello Daniel
As the script is set up at present the final step is to send the emails but no text is displayed to confirm emails are sent. You will need to integrate this into your own site with your own confirmations following success.
With regards to having to load the script 2 or 3 times before you get the contacts I think this can sometimes happen if you use the script multiple times with the same contact details. MSN grows suspicious if you ask for the contact list again just moments after it has been sent.
As the script is set up at present the final step is to send the emails but no text is displayed to confirm emails are sent. You will need to integrate this into your own site with your own confirmations following success.
With regards to having to load the script 2 or 3 times before you get the contacts I think this can sometimes happen if you use the script multiple times with the same contact details. MSN grows suspicious if you ask for the contact list again just moments after it has been sent.
Ehy! THX Jonathan Street!
This is perfect for me!
The script works!!!
THANK YOU!
(I'm Italian, sorry for my bad English)
This is perfect for me!
The script works!!!
THANK YOU!
(I'm Italian, sorry for my bad English)
I can't able to get libgmailer.php. plz send a correct code for this
Thanking you
Thanking you
The link isn't very obvious.
The direct link is: http://sourceforge.net/project/showfiles.php?group_id=116304
The direct link is: http://sourceforge.net/project/showfiles.php?group_id=116304
This is a minor note and detracts nothing from the actual usability of your script, which I find great, but in the "get_login_details.php" file above, you wrote: "To grab your contacts from MSN messenger enter your username (the part of your email address before the '@' symbol) in the username field, your password in the password field and then select Gmail," when I think you wanted to write, "To grab contacts from your Gmail account...." Maybe I'm being too persnickety, as that messages will likely be changed for any user implementing this script for their site, but I thought you should nevertheless be aware. By the way, did I mention this script is great?
You're right it does make no sense in the post. The demo and zip archive is actually correct so I must have noticed this previously but never updated the post.
Thanks for highlighting the oversight.
Thanks for highlighting the oversight.
Hi, thanks for your work 
I have a problem, i would not send emails to people who had already received this mail.
How could i do ?
sorry for my english
I have a problem, i would not send emails to people who had already received this mail.
How could i do ?
sorry for my english
Hi Maxime
I mention in my follow up post how annoying it could get it you don't put in the type of protection you're talking about.
The best way is to store the email address you've contacted and check this list each time you're about to send another. There are privacy issues with storing email addresses though so instead I suggest you store a hashed value. Running the email address through the md5 function before storing in a database or file should be sufficient.
If you need any further advice or would like me to run through the code just let me know.
I mention in my follow up post how annoying it could get it you don't put in the type of protection you're talking about.
The best way is to store the email address you've contacted and check this list each time you're about to send another. There are privacy issues with storing email addresses though so instead I suggest you store a hashed value. Running the email address through the md5 function before storing in a database or file should be sufficient.
If you need any further advice or would like me to run through the code just let me know.
Hello, thanks for your response 
I will appreciate if you could show me the code to insert. I'm as good in php as my english spoken ^^ lol.
If it could simplify your code, i dont need hashed values. Privacy issues list in France just need to be declared at CNIL.
Great thanks !
I will appreciate if you could show me the code to insert. I'm as good in php as my english spoken ^^ lol.
If it could simplify your code, i dont need hashed values. Privacy issues list in France just need to be declared at CNIL.
Great thanks !
Ok, I'll see what I can do. It might have to wait until the weekend though.
I want the same application in ASP simple ASP plz plz help me. i want to complete my university project.
Thankx in advance.
Thankx in advance.
Please take a look at the updated tutorial. It considers the security implications of this type of script in greater detail.
As for rewriting this script in ASP I am unable to help you. If you have any questions about what is happening in the PHP scripts I'll be happy to talk you through it but I can't do it for you.
I haven't looked for any comparable scripts in ASP so although they may be out there I don't know where.
As for rewriting this script in ASP I am unable to help you. If you have any questions about what is happening in the PHP scripts I'll be happy to talk you through it but I can't do it for you.
I haven't looked for any comparable scripts in ASP so although they may be out there I don't know where.
Could anyone help me i get this as a return in debug mode;
>>> VER 1 MSNP9 CVR0
> CVR 2 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS night__life@hotmail.com
> USR 3 TWN I night__life@hotmail.com
> VER 1 MSNP9 CVR0
> CVR 2 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS night__life@hotmail.com
> USR 3 TWN I night__life@hotmail.com
> SYN 4 0
>>> CHG 5 NLN
i checked 10 times if i had the correct login and pass. I tried to login on the test site and it worked... I am not sure what i did wrong. I am running my own apache server with php mysql. I enabled Curl in my php.ini and downloaded the curl for windows. Please help me.
>>> VER 1 MSNP9 CVR0
> CVR 2 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS night__life@hotmail.com
> USR 3 TWN I night__life@hotmail.com
> VER 1 MSNP9 CVR0
> CVR 2 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS night__life@hotmail.com
> USR 3 TWN I night__life@hotmail.com
> SYN 4 0
>>> CHG 5 NLN
i checked 10 times if i had the correct login and pass. I tried to login on the test site and it worked... I am not sure what i did wrong. I am running my own apache server with php mysql. I enabled Curl in my php.ini and downloaded the curl for windows. Please help me.
Hello Chris
That does seem odd. If it is getting to that point I would expect it to go to completion.
I'll take a look at the code and see if there is any likely explanation. I doubt I'll get a chance until tomorrow evening though.
That does seem odd. If it is getting to that point I would expect it to go to completion.
I'll take a look at the code and see if there is any likely explanation. I doubt I'll get a chance until tomorrow evening though.
i try to get the gmail contacts, but its give warning error. can u help me.
Warning: Invalid argument supplied for foreach() in /home/padgroc/public_html/test-gmail/choose_contacts.php on line 96
Thanks
Warning: Invalid argument supplied for foreach() in /home/padgroc/public_html/test-gmail/choose_contacts.php on line 96
Thanks
Hello Prabhu
I believe google is currently switching to a new interface for gmail and the developer behind the libgmailer class had not, the last time I checked, been able to update the class to reflect those changes.
I suspect that is why you're unable to fetch contacts. Hopefully it should be resolved soon.
I believe google is currently switching to a new interface for gmail and the developer behind the libgmailer class had not, the last time I checked, been able to update the class to reflect those changes.
I suspect that is why you're unable to fetch contacts. Hopefully it should be resolved soon.
A little while ago I wrote a tutorial looking at how to grab the contact list of a user and then send out an email to each of their contacts. The scripts in the tutorial did exactly what they claimed to do but they were fairly limited. Since writing the
Tracked: Oct 07, 14:28
There was an interesting article at 'The Register' today commenting on the potential dangers of 'Contact Us' forms. I bring it up because there was also a question asked today about the spam implications of the MSNM contacts fetching script. Many of the
Tracked: Feb 01, 23:12
There have been some requests to revisit the contacting a contact list tutorial and include additional features. Some of the requests have been for features mentioned in my original follow up dealing with some of the potential problems. That's great but
Tracked: Dec 02, 23:18