It’s been ages since I’ve used SMTP manually to send emails, and it seems a lot has changed.
It used to be you telnetted to port 25, used MAIL FROM: and RCPT TO: commands, and all would be hunky dory. But I’m having difficulty figuring out what the protocol is these days.
OK, my ISP here is Comcast. My web page and POP3 accounts are with another ISP, abac.com.
OK, seems all right, doesn’t it? But nothing comes through at my hotmail account, neither in my inbox or junk folder.
Now, if I try the smtp server at smtp.abac.com 25, it lets me through, but when I try mail from, it rejects my message. I’m assuming this is because it has no way of knowing who I am or authenticating me, since I’m logged in through the comcast account. It used to be that you can log in on pretty much anyone’s SMTP server and send mail from there, but that’s not the case anymore (understandably.)
So: a) What am I doing wrong with the Comcast SMTP? b) Is there anyway to remotely send an email from the abac.com SMTP server?
I only have the sketchiest idea of what’s going on here, so if I’m making stupid errors, this is why.
I’d be suprised if you could send via a telnet session from anywhere anymore. However…
Try mail from:<me@comcast.net> and see if it goes through. It is pretty standard to drop mail that a) doesn’t originate from your domain, or b) fails a reverse dns check. If your server is on a dynamic IP it might be running afoulf of situation b.
Your problem would be Authentication. Ever since spammers have been hijacking unsecured servers to deliver spam, ISP’s have cracked down hard on open mail servers.
The usual way I’ve seen is that you must be sending mail from the same domain, otherwise it is rejected with a error 550, relay denied.
Apart from that, maybe it’s using User/Password Authentication in which case I think the syntax is USERID and PASS.
Nobody 'round here seems to know what the comcast userid is. We don’t use it for sendmail or anything. Eudora is configures with smtp.comcast.net as the SMTP server.
Oh, wait…
It does seem ONE of my three emails finally came through. I’m surprised it takes this long though. When I use Eudora, the mail comes through more-or-less immediately. This has taken over a half-hour so far.
Which still leaves me with question 2… is there a way to authenticate myself to the smtp server at abac.com or is it impossible to send remote emails like that? I guess it’s not a problem if comcast is recognizing me and finally sending my emails. I’m just curious now as to why it took so long.
Let us suppose I want to write myself an app, just as an exercise. Unfortunately, my skills lie in good ol’ Commodore 64 BASIC. I would describe myself as an advanced to expert basic programmer. Unfortunately, I never upgraded my knowledge beyond this and a bit of assembly language.
So…
I want to write a small application that runs in the background, checks my pop3 servers every ten minutes or so. If it finds messages that conform to certain criteria, it will then email my mobile phone and send a text message with some basic info plus the first few lines of the message. (Yes, I know there’s probably programs out there or mobile packages that will let me do this, but just for education’s sake I’d like to do this.)
What programming language does it make the most sense for me to use to build something like this? The logic behind the program seems pretty straightforward to me. I just want to see if I could do it. Or is this far more complicated an operation than I think?
If this is possible, I figure I should also be able to communicate with my computer at home via mobile-based email. flag a special subject line, have the body of the message contain certain basic commands, and the computer can text me the results…
Just some thoughts that have been running through my mind…
This is actually not a very difficult process to realize, realistically. As far as checking the e-mail, I haven’t a clue about how to do that, but I can’t imagine that would be a difficult task as I’ve run into several code segments on the net showing simple ways of checking mail.
Beyond that, txting your phone would probably be another simple function, depending on your carrier. Many carriers have it set up so that you can either e-mail a txt message to your mobile phone, or send information via a URL on their own site. Depending on how you want to parse the information, this could be simple or involved.
For me, the hardest part would be checking the e-mail. Once you’ve got that, it’s relatively simple to perform tasks based on key words, and then to return that data to your phone through one of the above methods.
Texting my phone is simple. Just sendmail to myphonenumber@voicestream.net
Hence me trying to figure out the SMTP server jive. I just have absolutely no experience in running background tasks. BASIC programs on the C64 would always run “on top”, and exiting out of them would halt the program. I’m not sure how the PC architecture works. Obviously, it seems pretty simple, as pretty much all the programs I use can run in the background. I just don’t know whether certain languages are more condusive to that or not.
Perl would be the obvious first choice due to it’s superiour string handling capabilities but I’m not sure if you can get a perl compiler for C64’s. C would be the next most obvious solution using public string libraries.
Heh, I’d like to say I say I posted too soon, or that I’m an expert. But I can’t.
I will try to elaborate a little though.
Perl, IMHO, is a great starter language, that is very powerful in every way. Learning Perl will get you to your present goal in the shortest amount of time, while setting you up to migrate to other common languages, including C and/or PHP. There is a huge support network online for Perl (bigger than most anyway), and personally, everything I’ve written never needed anything more than Perl or PHP. This means anything from scripts that back up my work server every night, to secure database driven websites, to automating my lights and shit (merely proof of concept thus far). I learn programming languages on a “need to know” basis. I never needed anything more.
It is reassuring to know that my knowledge of Perl will help me when/if I decide to tackle C or its various derivations. It’s already been enough for me to hack and recompile certain programs for which I had the source code. Probably ugly though.
I’m sure 900 programmers will be along to tear me to shreads now.
On preview, Shalmanese, I don’t think he really plans to use a Commodore 64, but therein lies his previous BASIC experience.
Following on your last sentence, why not use your existing mail client, Eudora, to do this?
Set it up to poll the POP3 server every ten minutes. Create a filter based on your fancy criteria that would forward messages to your SMS email address. I haven’t tried, but I would suspect that lengthy messages would simply be truncated in SMS, doing pretty much what you wanted.
I also cut my teeth on BASIC (QuickBASIC mainly) and I find Python much nicer than Perl. All the SMTP and POP libraries you need are already there. A matter of taste perhaps, but Perl can be pretty cryptic, whereas I find Python very readable.
Sure, I could do this, but there are problems with that…Lengthy messages get sent as multiple SMSes (I think), plus I want to customize the program a bit more than Eurdora would let me. Besides, I’m mostly interested in this as a programming exercise. I’ve been meaning to learn a real programming language for quite some time now, and I learn best when I actually try to create something with a somewhat practical application.
Primarily, I suggested VB because of your current knowledge of BASIC. If you want to try to write something based on what you already know about programming, go for VB .NET.
Using Java is about on par with using C++ in terms of difficulty. I’ve found that once you learn one of them, the other quickly follows. They’re incredibly similar languages, and using one over the other for something like this is, I think, just trivial. If you’d have to pick one, I’d say go for Java because 1) the SDK is free (whereas you might not know where to get a C compiler) and 2) the online documentation makes self-learning a breeze.
Other than that, Eleusis’s suggestion of using PERL sounds like a good idea, as well, based on its abundant support network and superior handling of strings and SMTP libraries. The caveat, of course, is as Usram suggested- PERL is hard to wrap your head around at first, especially if you have little to no programming experience, and just looking at a bunch of PERL source code make you want to give up your desire to program. :>
Java would work great. Pretty much everything you’d need is already in the API and, as CompuHyperGlobalMegaNet pointed out, there is a wealth of documentation, sample code and tutorials online. I’d disagree with him that Java and C++ are equivalent difficulty though. It really is a truism that Java is C++ without the hard stuff - no pointers, no malloc, automatic GC, etc. It’s quite true that if you know C++, Java is a breeze. The reverse is not necessarily true because there are a lot of low-level things you have to do in C++ that you don’t have to do in Java.
The big difference between using Java and using Perl for this project will be if you want to put a GUI on your app. Java has lots of GUI options. Programmers complain a lot about them, but basically you can do anything you want with Swing, SWT and even the old AWT. There are several ways to tack GUIs on Perl, but they’ve always felt quite kluged to me. I use Perl a lot for admin scripts, and it’s the best language available for a lot of tasks, but if you want shiny baubles like GUIs, I’d use something else.
Compare the received: headers on this message to one that was sent from Eudora. It is probably just congestion somewhere along the way, not the fault of hitting SMTP directly.
It depends if abac.com has setup its mail server to do smtp authentication. If so, you’d need a username and password. It appears that you were trying to send email from outside abac.com to somewhere else outside abac.com, but using the mail server at abac.com to pass the message along. This is called relaying, and nobody in their right mind allows this anymore (unless you authenticate).