Need to send mail via lotus notes

guys here is a situation

I have a batch file which runs at 7:00 am in the morning(Task Schedular ) , and save its results in a text file , or i can even have its output in DOC or XLS file .

Now i want this file after creation ...let say 7:15 am to send me on my gmail account or any other .

I have a lotus notes Domino 6.5 and I am Administrator on this server .

two possible options are comming to my mind

one is that i create a script in a lotus notes server/ client to attach this Excel file automatically and send it to some address (possibly not likely to go for )
Because security Ploycies not give me chance to play around with server such scripts

other option is this  if i have a VBA code , i just go to excel and paste that code and enter the information like SMTP , mail address to be used and receivers address and all that informations , but for this i hope that there should be a client configured on this server , which are to read that .

bit confused !!!! need help on it


LVL 1
annasadAsked:
Who is Participating?
 
Bill-HansonConnect With a Mentor Commented:
You can use CDO to send email on any Windows machine running Windows 2000 or higher.  The cool part is that CDO does not require an email server, just access to an SMTP server.

Here's a simple example in VBA:
Sub SendEmail_CDO(ByVal sendto As String, ByVal subject As String, ByVal body As String, ByVal server As String)
    Dim iMsg As Object
    Dim iConf As Object
    Dim Flds As Object
 
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
 
    iConf.Load -1 ' CDO Source Defaults
    Set Flds = iConf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = server
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Update
    End With
 
    With iMsg
        Set .Configuration = iConf
        .to = sendto
        .CC = ""
        .BCC = ""
        .From = """TEST"" <test@something.nl>"
        .subject = subject
        .TextBody = body
        .Send
    End With
End Sub

Open in new window

0
 
annasadAuthor Commented:
no Replyy
0
 
SysExpertConnect With a Mentor Commented:
Other option is to use any of the command line mail programs such as the free BLAT
http://www.blat.net/


I hope this helps !
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
brwwigginsCommented:
agree with Sysexpert, Blat is an easy free alternative that should work for you as long as you allow the SMTP connection on Domino or have another SMTP server you can relay through
0
 
annasadAuthor Commented:
i am having problem in using blat , i downloaded that but how to use it , and one more thing , i will be attaching a xls file in my every mail and want to use send mail automatically , means it should execute with windows schedular task
0
 
annasadAuthor Commented:
bill can you explain me this code , where to save it and how to execute via scheduling windows task schedular , and aslo how this code will get an excel file from C:/Scripts/ folder and send it .
i should not need to press any button or do it manually ...


0
 
annasadAuthor Commented:
guys i am not much known to code , please assist me where to put that code , and save file and run this code to trigger mail , i know my servers smtp port , IP address , server name , sender address , and this information .

i know its spoon feeding , but i do not belong to the field the work has assigned to me
0
 
brwwigginsCommented:
the thing I noticed about blat is it makes it easier to have a txt file with the body of your message all typed out. Create the body of the message in notepad and save it somewhere as body.txt

next you must install blat on the system. Copy the blat.exe file to the c::\windows\system32 directory (or c:\winnt\system32 if using win2k or NT4). Then go to start->run and type the following (replacing the values in <>)

blat -install <smtpserver> <from_address@domain.com>

Next you will create a batch file to be used with windows scheduler. Open notepad and enter the following (again updating the values in <>). Keep the quotes where they exist. You must use quotes if you have any spaces for the path or subject lines

blat <"path_to_body.txt\body.txt"> -t <send_to@domain.com> -s <"Subject"> -attach <"path to file to attach">

Then save this file as email.bat and test it out. Once it you test it works ok then you can use windows scheduler to automate it

hope this helps
0
 
Bill-HansonCommented:
That depends on the tools available to you.

If it were me, I would probably write a LotusScript agent that would run on the Domino server, but you said that you probably would not want to go this route due to a security policy issue?  I'm not sure why this wouldn't work for you.

Another option would be to use a compiler like Visual Studio to create a windows application that relies on CDO.  Then you could run the application from Windows Task Scheduler.  The example I provided will send a plain text email.  There are more examples on this site for logging into a secure SMTP server as well as including file attachments.

http://www.paulsadowski.com/WSH/cdo.htm

If you are interested in using your Domino server, here's an example of a simple LotusScript agent that will send a text email with a file attachment:
Sub Initialize
	
	Dim sess As New NotesSession
	Dim db As NotesDatabase
	Dim doc As NotesDocument
	Dim body As NotesRichTextItem
	Set db = sess.CurrentDatabase
	Set doc = db.CreateDocument
	doc.Subject = "Test"
	doc.SendTo = "bill.hanson@mainline.com"
	Set body = doc.CreateRichTextItem("Body")
	Call body.AppendText("This is a test")
	Call body.AddNewline(2)
	Call body.AppendText("Here's a file attachment:  ")
	Call body.EmbedObject(EMBED_ATTACHMENT, "", "c:\temp\Installer.GIF")
	Call doc.Send(False)
	
End Sub

Open in new window

0
 
brwwigginsCommented:
one benefit I see to using blat or tool outside of notes is that you can call the e-mail command from the same batch file that creates the document (after it is created of course) and thereby can tie the two together.

If you use notes then you have to worry about checking if the attachment is there, domino can see the path, worry about missed schedules and so forth. In addition, if he does not have access to the domino server to test the code as he stated then it will be a little harder to iron out the process.
0
 
Bill-HansonCommented:
>> brwwiggins

Blat may be the answer, but he does have access to the Domino server:  "I have a lotus notes Domino 6.5 and I am Administrator on this server.".  It's a little confusing, though, because in the next sentence he states: "security Ploycies not give me chance to play around with server such scripts".  It sounds to me like he has access to Domino but not the physical server itself.

>> annasad

What access rights do you have to the Domino server?
What access rights do you have to the physical machine that hosts the Domino server?
0
 
annasadAuthor Commented:
i appreciate the help from you guys ...but nothing is as simple as i have found on searching and thats is
the one which fullfills all my requirements ...

http://www.febooti.com/
go and check it out

0
All Courses

From novice to tech pro — start learning today.