Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Cdont's Type Mismatch

by JayBonci (Curate)
on Feb 26, 2003 at 06:13 UTC ( #238673=note: print w/replies, xml ) Need Help??

in reply to Cdont's Type Mismatch

My guess is based on this: MSDN's CDONTS.newmail documentation.

Basically, you have:
The send format says it wants:
(optional) From as String, 
(optional) To as String, 
(optional) Subject as String, 
(optional) Body as Object or String, 
(optional) Importance as Long 
Importance is a number, not a string, so it's going to throw the type incompatible error, perhaps. The $AttachFile looks like it would use the ->AttachFile method. Keep in mind I haven't tested this.

Any reason why you aren't using Mail::Sender or something a little more perl-ish? It works great for me on Windows and Linux. Good luck.


Replies are listed 'Best First'.
Re: Re: Cdont's Type Mismatch
by Rafiq (Initiate) on Feb 26, 2003 at 12:19 UTC
    I would love to use Mail::Sender as I always have on a Linux system. Unfortunately our SMTP virtual server name is OOA and the code chokes on this code. I tried enetering but I get an error on that also. The SMTP server times out. Never had this problem with LINUX. I send the mail using both because it just easier to test and is not the reason for the problem. The code works fine until I add the $AttachFile part. It looks to me like I used the AttachFile Method correctly, evidently I did not. If I could figure out how I could get the sender module to work woth my SMTP virtual server I would be done ages ago becasue code resue would be swift and easy justice. Thanks for you help. Will keep plugging away.
      Honestly, the problem may be name resolution. It's a little known solution, but you can hardcode mappings of IP addresses to names inside of the windows hosts file, just as in Linux.

      On windows 2000 I know it's in <RootDrive>:\winnt\system32\drivers\hosts

      It's a simple text file. Good luck with it. Mail debugging can be sinister.

        My etc/host is showing this: localhost so would my next step be OOA or since it is a virtual SMTP server these two confuse me the SMTP logs show it as OOA but we sit on the domain Thanks for your help this is why I love Linux the forbidden OS here go figure.

      (Sorry for noticing this so late.)

      What version of Mail::Sender were you using? I seem to be able to connect to that server with Mail::Sender just fine (though it then of course kicks me out with "Local user "" unknown on host".

      Where does it actually time out? When connecting to the server? Or sometime later? Did you try the debug=> option to see the conversation between the script and the mail server? I really don't see any reason why would the name of the server matter as long as it may be resolved to an IP address.

      Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
         -- Rick Osborne

      Edit by castaway: Closed small tag in signature