Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Cdont's Type Mismatch

by JayBonci (Curate)
on Feb 26, 2003 at 06:13 UTC ( [id://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:
$objMail->Send($from,$to,$subject,$mailbody,$AttachFile);
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.

    --jaybonci

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 OOA.usafa.af.mil 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.

          --jaybonci
        My etc/host is showing this: 66.113.16.216 ALOweb.org 66.113.16.215 AFacademy.org 127.0.0.1 localhost so would my next step be 128.236.2.1 OOA or 128.236.2.1 OOA.usafa.af.mil since it is a virtual SMTP server these two confuse me the SMTP logs show it as OOA but we sit on the usafa.af.mil 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 "jenda@krynicky.cz" 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.

      Jenda
      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://238673]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found