|
|
|||||||
Since i don't have Outlook Express installed (to be honest, I'm allergic to O and OE), can someone test this script with it ? (don't forget to change the destination address) code: TIA [ 31 December 2001: Message edited by: Alex.H ] |
||||||||
|
|
|||||||
I had tested it with OE5.5 SP2. I got the following error: Script error : unknown command ! $MailItem.Importance=2 UPDATE: By every command who starts with $Mailitem. I get this error. [ 31 December 2001: Message edited by: awinkel ] |
||||||||
|
|
|||||||
Sorry, i've corrected my mistake. Forgot to rename a variable can you retest it ? |
||||||||
|
|
|||||||
Maybe it's handy to know that I haven't Outlook installed only Outlook Express. |
||||||||
|
|
|||||||
I get the following error yet. Script error : unknown command ! $MailItem = $Root.CreateItem(0) ; olMailItem object |
||||||||
|
|
|||||||
I've got my answer, thanks In fact, I was wondering if Outlook Express had the same automation object than Outlook, and the result you got show that it's not the case. Damn M$ Add this to be sure just after the createobject: [ 31 December 2001: Message edited by: Alex.H ] |
||||||||
|
|
|||||||
It returns: Invalid class string |
||||||||
|
|
|||||||
I'm running this on winXP and office XP It prompted me with the "A program is trying to automaticall send e-mail on your behalf. Do you want to allow this? " It will sort of work... |
||||||||
|
|
|||||||
So it's clear that it will work with Outlook but doesn't work with Outlook Express. Maybe a new project? |
||||||||
|
|
|||||||
Outlook is installed with Ms Office. Outlook Express is his little brother, completely free(!) and without some (most of ?) features On the other hand, i didn't know that Ms add this messagebox. Well, a sendkeys("Enter") will be enough. Thanks guys [ 31 December 2001: Message edited by: Alex.H ] |
||||||||
|
|
|||||||
Alex, are you working on a new outlook virus? it's just looking like it... |
||||||||
|
|
|||||||
Lol Just a way to send a mail only with usual mail utilities. |
||||||||
|
|
|||||||
Alex, Does this work for you? code: HTH, - Kent |
||||||||
|
|
|||||||
FYI<BR>I'm running Windows 2000 SP2 with Outlook 2000 SR1<P>Kent,<P>I could not get your code to work at all. It says it does not understand this line:<P>$theNameSpace.Logon "profile", "password"<P>even if I supply valid info in its place.<P><BR>Alex H<BR>I get the following error using your code.<BR><BLOCKQUOTE><font size="1" face="helvetica, arial, sans-serif">code:</font><HR><pre>$Root = CreateObject("Outlook.Application")<BR>$MailItem = $Root.CreateItem(0) ; olMailItem object<BR>? @ERROR<BR>? @serror<BR>$MailItem.Importance=2<BR>$MailItem.Subject = "Automation Test"<BR>$MailItem.To = "man@hotmail.com"<BR>$MailItem.Body = "this is a test 2 sample of a future SendMail UDF()"<BR>$MailItem.Send<BR>? "Next error log..."<BR>? @ERROR<BR>? @serror<BR></pre><HR></BLOCKQUOTE><BR><B>kix32.exe mailit2.kix<BR>0<BR>The operation completed successfully.<BR>Next error log...<BR>1<BR>COM exception error "Send" (Microsoft Outlook - Outlook does not recognize one or more names. ) [1/1]</B><P>It looks like it has some kind of problem with the SEND command maybe.<p>[ 02 January 2002: Message edited by: NTDOC ] |
||||||||
|
|
|||||||
Duh! NTDOC, You need some rest (me too). Please, correct this by adding a second @ in the address. kdyer, Radimus and awinkel, |
||||||||
|
|
|||||||
Okay Alex... Your right, I was not even really looking at the code. I took it at face value and ran it. adding the @ to the address so that it is @@ works fine on my system. |
||||||||
|
|
|||||||
Alex, Works great! Couple of suggestions.. After the send piece, I added: To cleanly close out of Outlook. Have a look at - http://www.mvps.org/word/FAQs/InterDev/SendMail.htm and there is a "test function" to see if Outlook is open and if not, it closes it otherwise, it remains open. Thanks! - Kent |
||||||||
|
|
|||||||
it works, but the Outlook security still blocks it... oh well you can't have everything. MS will be pissed if you guys figure out how to send Anthrax through Outlook... as that is the only virus to not be propigated using MS software... |
||||||||
|
|
|||||||
It works excellent. . Is there a way to send attachment with the e-mail? Is there a way to place active shortcut in the e-mail body. Thank you. [ 06 January 2002: Message edited by: attiahia ] |
||||||||
|
|
|||||||
I didn't really get a look to this part, only the possbility to send a mail when all is getting wrong, something like : Hey sucker, your f$^ù script don't work at all unless the sendmail for this user : ... Now go and correct this and don't ever mind to sleep this night. But you should get a look to the link kdyer provide, the attachment part is at the end (in VB, but easy to transcribe). |
||||||||
|
|
|||||||
attiahia, Make the following modifications to the script, and you should be good to go! code: HTH, - Kent |
||||||||
|
|
|||||||
Alex, Kdyer Thank you a lot . Can I place shortcut or URL in the e-mail? Thanks |
||||||||
|
|
|||||||
I believe it depends on the SP of Outlook. For example, Outlook 2000 up to SP-2 allows "dangerous" extensions to be sent through (like EXE). I believe there are patch work-arounds for this too, however Outlook XP has settings to turn these features on or off. HTH, - Kent |
||||||||
|
|
|||||||
I've UDF'ed this, since it works in my work environment... code: |
||||||||
|
|
|||||||
I want to send an exe shortcut (\\Server_name\Shared_Name\Program.exe) as body of the e-mail. I tried: $MailItem.HTMLBody = "\\Server_name\Shared_Name\Program.exe" But did not work. Please Help [ 04 February 2002: Message edited by: attiahia ] |
||||||||
|
|
|||||||
attiahia, try this one instead : $MailItem.HTMLBody = "\\Server_name\Shared_Name\Program.exe.lnk" Also, did you manage to get something with AD ? I completely lost (and forgot, i have to say) the thread about it. |
||||||||
|
|
|||||||
I am really receiving great support from you and some time I feel that I owe you. $MailItem.HTMLBody = "\\Server_name\Shared_Name\Program.exe.lnk" But when I tried to use it to handle our internet user, it did not work. I know that some time (maybe all time) my questions become boring, therefore I do not like to repeat my LDAP question/problem here again. Please extend your usual help and refer to it in the scripts forum http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=002711 [ 05 February 2002: Message edited by: attiahia ] [ 05 February 2002: Message edited by: attiahia ] [ 05 February 2002: Message edited by: attiahia ] |