Jump to content

_EmailSend() Func. Ready to use.


ezzetabi
 Share

Recommended Posts

It is not a solution at all. (Or I am missing something.)

I mean, if I delete the file at the end of the func, it will not be there when I'll restart it. So I'll fileinstall blat everytime.

And the Start/Exit thing was there for this.

Link to comment
Share on other sites

  • Replies 83
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Developers

It is not a solution at all. (Or I am missing something.)

I mean, if I delete the file at the end of the func, it will not be there when I'll restart it. So I'll fileinstall blat everytime.

And the Start/Exit thing was there for this.

<{POST_SNAPBACK}>

True, but that will be the only solution to be able to fileinstall it.

I wouldn't worry about that at all. Believe that making it so that it works in every situation is more important. I would use functions like this in an #include and it should work for me without having to open the included file first to modify it.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

how might the script be modified to work with lotus notes ?

for those not familiar with notes, there is no pop3/smtp setting as the mail is sent via a domino server

<{POST_SNAPBACK}>

SMTP works with Notes but you will have to turn on the SMTP service on the notes server.

Below is a VBS script I pickup a while ago and made an AutoIt3 Function for it...

It creates a VBS script and then runs the script to sent the Notes message.

it does require the notes client on the PC sending the message.

;
Func SentNotesMsg($MsgTxt)
   FileDelete(@TempDir & "\NotesMsg.vbs")
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Dim recip(2)')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'recip(0) = "User1@????.com"')
  ;FileWriteLine(@tempdir & "\NotesMsg.vbs",'recip(1) = "User2@????.com"')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesSession = CreateObject("Notes.NotesSession")')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesMailFile = objNotesSession.GETDATABASE("", "")')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'objNotesMailFile.OPENMAIL')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesField = objNotesdocument.APPENDITEMVALUE("Subject","*** Subject of the message")')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesField = objNotesdocument.APPENDITEMVALUE("SendTo", recip)')
  ;FileWriteLine(@tempdir & "\NotesMsg.vbs",'Set objNotesField = objNotesdocument.APPENDITEMVALUE("CopyTo", "user3@????.com")')
  ;FileWriteLine(@tempdir & "\NotesMsg.vbs",'Set objNotesField = objNotesdocument.APPENDITEMVALUE("BlindCopyTo", "User4@???.com")')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesField = objNotesdocument.CREATERICHTEXTITEM("Body")')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'With objNotesField')
   $array = StringSplit($MsgTxt, @LF)
   FileWriteLine(@TempDir & "\NotesMsg.vbs", '    .ADDNEWLINE 1')
   For $x = 1 To $array[0]
      FileWriteLine(@TempDir & "\NotesMsg.vbs", '    .ADDNEWLINE 1')
      FileWriteLine(@TempDir & "\NotesMsg.vbs", '    .APPENDTEXT "' & $array[$x] & '"')
   Next
  ; use to attach a file
  ;FileWriteLine(@TempDir & "\NotesMsg.vbs", '     .EMBEDOBJECT 1454, "", "c:\temp\file.txt"')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'End With')
  ; save the message in the Sent folder
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'objNotesdocument.SAVEMESSAGEONSEND = True')
  ; sent it and clean up
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'objNotesdocument.Send (0)')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesSession = Nothing')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set bjNotesSession = Nothing')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesMailFile = Nothing')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesDocument = Nothing')
   FileWriteLine(@TempDir & "\NotesMsg.vbs", 'Set objNotesField = Nothing')
  ; run the actual script
   $rc = RunWait(@ComSpec & ' /c Wscript.exe "' & @TempDir & '\NotesMsg.vbs" //T:30 > sent.log 2>&1', @TempDir, @SW_HIDE)
  ; test the Return code here
  ; if $rc = ? then 
  ; cleanup file
   FileDelete(@TempDir & '\NotesMsg.vbs")
EndFunc  ;==>SentMsg

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

as a notes end user, I have no control access to domino and can not influence any settings on it, thus unable to turn on or off anything on domino (anyway, it's located in another state from where my client access runs)

also, does notes 6.5 client have to be running to use the example .vbs ?

..finally, I assume line 6 would have to contain at least one hard coded email address or how is the address being passed ?

Link to comment
Share on other sites

:Anyway, if can't find a smtp server, just make one starting hidden or as service

that will not work on a company LAN behind a proxy server

the email server is domino and it uses lotus notes 6.5 client access

end users can not install or run anything on their desktops

Link to comment
Share on other sites

  • Developers

as a notes end user, I have no control access to domino and can not influence any settings on it, thus unable to turn on or off anything on domino (anyway, it's located in another state from where my client access runs)

also, does notes 6.5 client have to be running to use the example .vbs ?

..finally, I assume line 6 would have to contain at least one hard coded email address or how is the address being passed ?

<{POST_SNAPBACK}>

Well, presumably the Notes mail environment has an hook into Internet mail so on one of the Notesserver you have to have the SMTP service running.

Anyway, the vbs script will start the client if its not running.

you can hardcode the target email address or change the script to use a variable.. it was just to show you how it can be done....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

:Anyway, if can't find a smtp server, just make one starting hidden or as service

Don't understand how this would help.

that will not work on a company LAN behind a proxy server

the email server is domino and it uses lotus notes 6.5 client access

end users can not install or run anything on their desktops

<{POST_SNAPBACK}>

That limits the options ..... :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Well.. for FYI purposes. Where I work.. we also use Lotus Notes server R6 and 6.5.2 Notes client. I use Blat.exe from my %Windir% to send emails to cell phones all the time. When you first run Blat, you need to run it with "Blat install" stating the SMTP server (Domino in this case) and the user id. Since your id authenticates to this server

it will send out your Blat email as (well.. your id). If you are able to send email to 123@somecompany.com then you should be able to send it through Blat. I'll be trying out Ezztabi's script.

RocTx

Link to comment
Share on other sites

  • Developers

If you start a SMTP server you can send mail. And if you could not send the email before it means that helped.  :">

<{POST_SNAPBACK}>

Yep agree..... but i read that it would be started on the pc... and that wouldn't help much right ???

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

:RocTx

:6.5.2 Notes client.

:When you first run Blat, you need to run it with "Blat install" stating the SMTP

:server (Domino in this case) and the user id. Since your id authenticates to this

if not too much trouble, kindly post an example cmd string for blat

with the domino servername like ABCD1234 and the userid like JSmith.id ?

thanks

Link to comment
Share on other sites

  • Developers

:RocTx

:6.5.2 Notes client.

:When you first run Blat, you need to run it with  "Blat install"  stating the SMTP

:server  (Domino in this case) and the user id.  Since your id authenticates to this

if not too much trouble, kindly post an example cmd string for blat

with the domino servername like ABCD1234 and the userid like JSmith.id ?

thanks

<{POST_SNAPBACK}>

AutoIt, you don't need the ID file since it uses the SMTP service of the Notesserver, which doesn't requier authentication. Only when using the POP service, you would need a userid/password, but that would be the Internet info for the user that is located in the person document inside the Names.nsf.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

:you don't need the ID file since it uses the SMTP service of the Notesserver,

ok

this is what I tried (from a cmd window and in the \blat\full\ folder)

blat -install ABCDE1234/SVR/SVR01 (this is what my notes server looks like)

I also tried

blat -install ABCDE1234 firstname.lastname

blat accepted either one but when I try

blat source.txt -subject "test" -to firstname.lastname

it will not connect and returns message (Error: can't resolve hostname ABCDE1234, Error: not a socket)

does lotus have to be up and running in the background ?

if I get this to work, then the emailsend will work with just a couple small tweaks for lotus users also

Link to comment
Share on other sites

  • Developers

:you don't need the ID file since it uses the SMTP service of the Notesserver,

ok

this is what I tried (from a cmd window and in the \blat\full\ folder)

blat -install ABCDE1234/SVR/SVR01 (this is what my notes server looks like)

I also tried

blat -install ABCDE1234 firstname.lastname

blat accepted either one but when I try

blat source.txt -subject "test" -to firstname.lastname

it will not connect and returns message (Error: can't resolve hostname ABCDE1234, Error: not a socket)

does lotus have to be up and running in the background ?

if I get this to work, then the emailsend will work with just a couple small tweaks for lotus users also

<{POST_SNAPBACK}>

do you know what the ip address is of the notesserver ?

As a test just try to ping the hostname or ip address before trying blat.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

While you can use 'blat -install' to create registry entries for blat to use you don't have to. Ezzetabi's function uses command line options that override the registry entries anyway. If the function is missing an option that Lotus Notes needs then it can be added to the function. Personally, I don't want all that information in the registry unless I'm the only person with access to the computer.

john925

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...