On Thu, 3 Feb 2005 19:21:39 +0000, Mark Quitoriano <[EMAIL PROTECTED]> wrote: > how can i parse info from an email message to an asp site?
you're building a mail to web gateway? i haven't done that, but there might be tools to do that already, and if you program, it's not hard (how to do it might vary by language though, since some convenient libraries in one language might not exist on other languages. google is your friend, but maybe someone else on the list will point you in the right direction too. > ____________________________ > subject: sms letter > body: > > phone +6329111111 > msg hello world > ___________________________ are you already able to strip out the relevant parts out of the email? or are you still working on the parsing part? in general, cut your problem apart into logical bits that are, individually, easier to attack. so first figure out how to do the parsing. you might want to post details about your environment (e.g., how do you receive the emails? do you have a cron job that checks pop3 and, after getting the email, parses it? or do you have a .procmailrc that receives all incoming mail and will run an external program to parse and post? or maybe you have a job that reads the /var/spool/mail/<inboxfile> directly? etc. as always, http://www.catb.org/~esr/faqs/smart-questions.html applies. in particular: http://www.catb.org/~esr/faqs/smart-questions.html#beprecise > i want it to transfer the info from that email to an asp page > something like > http://asp-server/sms.asp?number=+6329111111&msg=hello%20world one thing to consider. your example uses HTTP GET. HTTP GET is often implemented (not sure about [OT] IIS [/OT], but definitely in apache) by passing the parameters in the environment. and most shells have limits on how much data can be passed in the environment. if your email is going to be longer than the environment of the OS that runs that ASP script, only part of the message will be posted, and possibly the whole thing might fail (depends on how the web server handles user error). you might want to use HTTP POST if you can. ahh, on the other hand, kung sms.asp yan, it's probably limited to 160 or n*160 where n<=3, so maybe GET is OK. GET also has other weaknesses (the messages get stored in proxy caches along the way, etc), but if that doesn't matter because the message never goes outside your network and you trust all your users, then you can ignore that. what language are you going to use to post? in almost any language i know, http GET is trivial. heck, you can even do it in shell script using wget or curl. on the other hand, if the program that's going to be posting runs in windows then this is OT and you're on your own since i avoid windows programming as much as i can. but perl and php run on windows, so you can figure out how to do that in either of those. it's trivial in either. tiger -- Gerald Timothy Quimpo http://bopolissimus.blogspot.com [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78" Mene sakhet ur-seveh -- Philippine Linux Users' Group (PLUG) Mailing List [email protected] (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
