Solved

sending documents on the web through emails using domino

Posted on 2004-08-17
19
298 Views
Last Modified: 2013-12-18
hi all,

I want to send an web email that contains a coverletter and resume.Here is the description:

For my website, I have a Resume submission aplication form with a " rich text field "(to type coverletters), a "file upload control" (to upload resumes) and a "submit button".

When user clicks on submit, the rich text field and the document in the file upload control should reach a destination email address.

Can i write an agent to do this? Are there any online resources that describe how to do this ?

thanks,
Jay

0
Comment
Question by:jaggernat
  • 9
  • 8
  • 2
19 Comments
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
Place this is in an agent:

Sub Initialize
      Dim session As New NotesSession
      Set db = session.CurrentDatabase
      Set maildoc = db.CreateDocument
      Dim doc As notesDocument
      Dim rtitem As NotesRichTextItem
      Dim Body As NotesRichTextItem
      
      Set doc = session.DocumentContext
%REM
> >      doc.Form = "BackupRequestForm"
> >      doc.SendTo = doc.ReportingTo(0)
> >      doc.Subject = "Domino Application"
> >      Call doc.send(True)
%END REM
      tmpreqname=doc.name_x(0)
      tmpreqcomp=doc.compname_x(0)
      tmpcontact=doc.contact_x(0)
      
      maildoc.Form = "Memo"
      'maildoc.SendTo = doc.ReportingTo(0)
      maildoc.SendTo = doc.staff1_x(0)
'      maildoc.CC=doc.staff2_x(0)
      maildoc.Subject = "You have a new request from "+tmpreqcomp
      Set Body=New NotesRichTextItem(maildoc,"Body")
      Set rtitem = New NotesRichTextItem( maildoc, "Body" )
'Call rtitem.AppendDocLink( doc, db.Title )
      message="Please review new request from "+ tmpreqname+" from "+tmpreqcomp+"."
      Call rtitem.AppendText(message)
      Call Body.AddNewLine(2)
      Dim rt As Variant
      Set rt = doc.GetFirstItem ("YourUploadFieldName") 'RTF field
      Call rtitem.AppendRTItem ( rt )
      message1="Click here to open the form=========>>"
      Call Body.AppendText(message1)
      Call Body.AppendDocLink(doc,"Please Click this Link to open the Document")
      Call maildoc.send(False)
      'Msgbox"Mail Send "
      'Wend
      Print "processed"
End Sub


Manually from Actiosn menu
Run Once @Comamnds....
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 500 total points
Comment Utility
and a simple agent :
1. Create an Agent (i.e. agnSendMail) triggered from the agent list, Run Once options.
2. Paste the code below
3. In a button or hotspot of your form add the following:
@Command([ToolsRunMacro]; "(agnSendMail)")


'Agent Code
Sub Initialize
Dim s As New notessession
Dim db As notesdatabase
Dim memo As notesdocument
Dim webdoc As notesdocument
Set db = s.currentdatabase
Set webdoc = s.documentcontext
Set memo = New notesdocument(db)
Call webdoc.CopyAllItems(memo, True)
memo.form = "Memo"
memo.SendTo = webdoc.Email(0)
memo.CopyTo = webdoc.CreatedBy(0)
memo.Principal = webdoc.CreatedBy(0)
memo.Subject = webdoc.subject(0)
memo.Body = webdoc.Body
Call memo.Send(True)

End Sub
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Follow this simple steps.

1. Create two hidden fields
MailOptions and set value to "1"
SendTo (multivalued for more than one person) WITH recepient names

2. Enable form property store form in document & save the form

Now when user uses this form to submit it will send the mail to the users listed in SendTo Field

~Hemanth

0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
Hello hemanth,

that sounds simple .. but a little bit of clarity would help.
where should i enter the email(s) in the SendTo field??

Will this procedure send the "rich text field" and the "file upload control document"  to the recipient ?  

thanks,
Jay
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Sorry I couldn't get back to you.. hope you got what you need
0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
No, i did not. I wnated to know where to enter the recipient email address in the SendTo field?

I will greatly appreicate your responce.


J
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
It is a field and hidden.. You have to hard code it.

It will send whole form, when you enable store form in document.
0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
By "hard code" , you mean setting value of the field, or what?

thanks,
J
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
yes.. setting the default value to whom ever want to receive the mail after submitting the form
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 10

Author Comment

by:jaggernat
Comment Utility
This is just not working. I did exactly what you said.

Have a MailOptions field and set value to "1"  (hidden)

SendTo field with recepient names (hidden).



Does this work on the web or just on NOTES?


Do i have to configure any thing else?

thanks,
Jay.

0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
both web and notes.

Where is this web server ? if your web server cannot talk to the mail server then you can't send mail. ROuter task should be running on web server if not atleast smtp should run (in this case use internet address).
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
also leave the fields as editable...and try
0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
I am working on a client machine connected to Domino server. The Database is stored in the server.

How can i make the web server talk to the mail server?

Thank you
J

0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
How do you test mailing in your web server .. eg: How does your scheduled agent sends mail on this web server ?? Mostly use smtp to route mail when disconnected from the mail mail server.. so that the mail is send to internet and received by mail server from internet.

Does your web and mail server share same address book ? If so they can see each other ?
0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
excellent solution ..the email is passing now .but another problem..

the rich text field is not showing up .

Also when i click on the attachment it says :

Response Message
HTTP Web Server: Item Not Found Exception
 

any help would be greatly appreciated.


thanks so much,
J
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Name the richtext field as Body.. this should match up with the mail format. Also create Subject field to define the subject.

About the attachment .. I am not sure why you are getting that error. It could be that attachment is not sent by the router or stripped by virus scanner.
0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
hey it works perfect now ....Hats off to you..

J

0
 
LVL 10

Author Comment

by:jaggernat
Comment Utility
Hello Hemantha,

I wanted to ask this to you. I have a good experience in designing web applications in Lotus Domino. Now , i want to move a step forward and start using java in my applications. What you think is the best web resource or book i can get started with. I have used java before but not with Lotus Domino.


Regards,
J



0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Cost effective - Notes help and redbooks

If you are willing to shed some money - then try Domino Development with Java by Anthony Patton

Still I would always prefer to goto lotus and ibm sites for tutorials on using java in domino and then start with rebooks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now