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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

annasadAuthor Commented:
no Replyy
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("") = 2
        .Item("") = server
        .Item("") = 25
    End With
    With iMsg
        Set .Configuration = iConf
        .to = sendto
        .CC = ""
        .BCC = ""
        .From = """TEST"" <>"
        .subject = subject
        .TextBody = body
    End With
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Other option is to use any of the command line mail programs such as the free BLAT

I hope this helps !
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

brwwigginsIT ManagerCommented:
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
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
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 ...

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
brwwigginsIT ManagerCommented:
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> <>

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 <> -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
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.

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 = ""
	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

brwwigginsIT ManagerCommented:
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.
>> 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?
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 ...
go and check it out

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.