Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

sending documents on the web through emails using domino

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
jaggernat
Asked:
jaggernat
  • 9
  • 8
  • 2
1 Solution
 
madheeswarCommented:
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
 
madheeswarCommented:
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
 
HemanthaKumarCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jaggernatAuthor Commented:
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
 
HemanthaKumarCommented:
Sorry I couldn't get back to you.. hope you got what you need
0
 
jaggernatAuthor Commented:
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
 
HemanthaKumarCommented:
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
 
jaggernatAuthor Commented:
By "hard code" , you mean setting value of the field, or what?

thanks,
J
0
 
HemanthaKumarCommented:
yes.. setting the default value to whom ever want to receive the mail after submitting the form
0
 
jaggernatAuthor Commented:
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
 
HemanthaKumarCommented:
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
 
HemanthaKumarCommented:
also leave the fields as editable...and try
0
 
jaggernatAuthor Commented:
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
 
HemanthaKumarCommented:
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
 
jaggernatAuthor Commented:
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
 
HemanthaKumarCommented:
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
 
jaggernatAuthor Commented:
hey it works perfect now ....Hats off to you..

J

0
 
jaggernatAuthor Commented:
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
 
HemanthaKumarCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 9
  • 8
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now