I would like to send emails using Perl for a virtual cards script. I do not have sendmail or a server to send out emails. I have to use a program called Blat. But, I can only send out emails if I know the SMTP of the recipient.

I wouldn't say "never" for anything regarding programming. There is usually a solution somewhere.

I think it would be very bad to try and guess at the user's SMTP... it needs to work 100% of the time... why should some people get messages and some not?

I am new to using the mail program Blat, and I really got stuck when I didn't have an SMTP to use. The script was working fine for a while... then, the SMTP I was using didn't allow me to send the messages. When I asked in the Blat Help Yahoo group regarding the lookup of an SMTP, someone mentioned looking at http://search.cpan.org for modules (Net::DNS and Net::SMTP), and they said it would be a very complicated process... so I didn't really want to with that solution.

I have everything coded in Perl, but I can also use ASP. I know how to call another Perl script within a Perl script, but how do you call Web pages or ASP within a Perl script? I can use CDNOTS to send out mail, so I could do the majority of everything in Perl and send out the mail using ASP if there's a way to call or refresh to an ASP page (using Perl not a refresh tag or something like that). Please let me know if you have any examples on what I am looking for or if you have any suggestions. Thanks.

I wouldn't say "never" for anything regarding programming. There is usually a solution somewhere.

I would. Excluding solutions by design creates this condition.

In Reply To

... why should some people get messages and some not?

Because you insist upon something called BLAT and refuse to run a mail server.

In Reply To

... CPAN ... so I didn't really want to with that solution.

Exploit CPAN cause that's what it's there for. Refuse to use CPAN and suffer, it's as simple as that.

Email::Valid"This module determines whether an email address is well-formed, and optionally, whether a mail host exists for the domain. "

In Reply To

... but how do you call Web pages ...

you read PERLFAQ, there is 9 big pages. There is also the ActivePerl FAQ , which covers additional topics.

Since "web pages" are just that, "web pages", and aren't "programs" on your system, you can't "call" them ( you can, but you can also call me thebitch, but it won't do you any good, cause i'm not a program on your system )

I think you're looking at this the wrong way. You don't need to find the recipient's SMTP server, you just need to find _an_ SMTP server that you can use. Once you've passed the mail onto an SMTP server, then that will pass it on to the next one - and so on until it reaches your recipient.

Surely whoever gives you connectivity to the internet will be running and SMTP server that you can use. You should just find out where that is.

I do not have any control of the server my site is at, and my host only installed Blat... probably because it is an NT server and they have ASP related email programs. The script I have is all Perl, and I spent quite a long time modifying the original to fit in with my Web site. So, I do not want to redo the entire thing in ASP.

If my domain was at www.foo.com and my mail server was at mail.foo.com, I can not send out emails to users outside of the foo.com domain. I am not sure why, but I will complain to the host later on today. Even using regular email clients like Outlook, there is that same problem. On the host's help page, they tell you to use your Internet service provider's SMTP. So, I will have to investigate the mail server problem with my domain.

I had tried using my ISP's SMTP, but I still error when the domain is different than the domain of the recipient... maybe there is a relay problem with how the host setup Blat... I will ask them about this, also.

So if the script was named "myscript.cgi", there is no way to call the script and then end up on some other page like "anotherpage.asp" after the script is done processing (without using a refresh meta tag on the output page)?... meaning I will always end up on myscript.cgi after everything is finished?

Thanks RedRum. I did get the gist of what Dave was saying, but I was trying to see if there was a way to send to e-mail address authenticated by the SMTP server (only known to)... that's why I mentioned tracing each SMTP. The original problem I was having with Blat was that only e-mail addresses know to the SMTP servers worked. But, my script now works again: http://www.wgpkr.com/GPK/ECards/ After my call to the host, they seemed to fix the mail server problem. And, I updated the script to use my e-mail server and information.

I felt thebitch's responses were confrontational and not helpful... most of everything said was contradictory to what I said I wanted to do, could do, or was using in my script. If I need help with a script or have a question, thebitch is a person I do not want help from.

I do still have the question about ending up on a non-cgi/pl page when the script is finished running... like doing a refresh or redirect (not HTML meta tag refresh). Is this possible in Perl? I've used that sort of thing with ASP many times and thought something similar might be built into Perl. Let me know. Thanks.

I do still have the question about ending up on a non-cgi/pl page when the script is finished running... like doing a refresh or redirect (not HTML meta tag refresh). Is this possible in Perl? I've used that sort of thing with ASP many times and thought something similar might be built into Perl.

It's not a Perl issue, but an HTTP issue. You can return a "redirect" (403) response code together with a "Location:" header to get the client to redirect to another page.

The easiest way to do that in Perl is to use the "redirect" function from CGI.pm.