call a method in asp.net page, when ever a new mail is receive.

Posted by Modit under ASP.NET on 8/22/2011 | Points: 10 | Views : 1220 | Status : [Member] | Replies : 3
i am looking for a way thru which when ever i receive a new mail in my mail box , some method in my .aspx page is called automatically.




Responses

Posted by: Vuyiswamb on: 8/22/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
i really dont understand what you mean.

Can you please try again explain exactly what you are trying to do , we might give you some alternative solutions or better ideas on how to achieve it.



Thank you for posting at Dotnetfunda
[Administrator]

Modit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Modit on: 8/22/2011 [Member] Starter | Points: 25

Up
0
Down
The thing that is going to happen is , i have a mail account , what i require is when ever i receive any mail in that account , i would like to read that mail to to automatically read and forward the body of the mail as an sms to some predefined mobile numbers.

Lets take an example i have a mail in mail server, a user dends me a mail with a body "new location in xyz location" , as soon as the mail reaches my mail box, i would like to crate a web service or somethig which will automatically send me the sms.
I have a required code to send sms, all i am looking for is how can i create something that automatically checks for new mails.

Modit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 8/23/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
You need a Windows service, that will keep on checking a new mail and do the sms.

1) So the First thing you need to do, is to check for new emails

2) If you are able to find the new email create a function that will send an sms.

If you are using a windows service , you can configuire it to do that at certain intervals.

I have written an article on windows service some time ago, where i killed a "NOtepad" process every 5 seconds, there you can use your function to to check for new email if there is one take the body of that message and send it via sms as you wanted. here is a skeleton on how to do this

http://www.dotnetfunda.com/articles/article191.aspx

Thank you for posting at Dotnetfunda
[Administrator]

Modit, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response