Set "From address" n Notes email from VBA

This is a discussion on Set "From address" n Notes email from VBA within the lotus-notes-admin forums in Other Technologies category; I am contracted with an organization that uses Lotus Notes. Unforunately, I have zero experience with it. My task is to automate the production of some Crystal reports and then email them via Notes. That much I have done. Now, I'll try to explain the problem. The emails are sent from a workspace mailbox that is not mine (not sure is the jargon si correct). I can open it and look at the Sent folder. The mail items show up as they should. Here's the issue -- when I open the Sent folder and look at a message I ...

Go Back   Database Forum > Other Technologies > lotus-notes-admin

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-22-2008, 11:04 AM
Default Set "From address" n Notes email from VBA

I am contracted with an organization that uses Lotus Notes.
Unforunately, I have zero experience with it. My task is to automate
the production of some Crystal reports and then email them via Notes.
That much I have done. Now, I'll try to explain the problem.

The emails are sent from a workspace mailbox that is not mine (not
sure is the jargon si correct). I can open it and look at the Sent
folder. The mail items show up as they should. Here's the issue --
when I open the Sent folder and look at a message I created in code,
the From field shows my name. That's Ok. But when another person
opens the sent folder and looks at the message, it shows their name as
the From address.

Oddly, when any recipient opens the message in their own inbox the
From address is consistently mine.

Here is the pertinent part of my code.

Set MailDoc = MailDb.CreateDocument

With MailDoc

.Form = "Memo"
.SendTo = SendTo ' an array of addresses
.CopyTo = CopyTo ' an array of addresses
.Principal = "Something other than me"
.Subject = Subject ' var holding subject line
.Body = Body ' var holding body text
.SaveMessageOnSend = True

.PostedDate = Now() 'Gets the mail to appear in the sent items
folder
.Send False

End With


Does anyone know of a way to set the From address -- or, at least,
make sure that it always shows the name of the sender no matter who
opens it?

Thanks.

Reply With Quote
  #2  
Old 08-24-2008, 03:06 PM
Default Re: Set "From address" n Notes email from VBA

I'm guessing that there is no "From" field due to the way the message is
being mailed from VB. The copy the users get has a "From" field because
Notes puts it there.

You could try saving a "From" field after the message has been sent.

Tim Mohrlant

sebair-at-gmail.com wrote:
> I am contracted with an organization that uses Lotus Notes.
> Unforunately, I have zero experience with it. My task is to automate
> the production of some Crystal reports and then email them via Notes.
> That much I have done. Now, I'll try to explain the problem.
>
> The emails are sent from a workspace mailbox that is not mine (not
> sure is the jargon si correct). I can open it and look at the Sent
> folder. The mail items show up as they should. Here's the issue --
> when I open the Sent folder and look at a message I created in code,
> the From field shows my name. That's Ok. But when another person
> opens the sent folder and looks at the message, it shows their name as
> the From address.
>
> Oddly, when any recipient opens the message in their own inbox the
> From address is consistently mine.
>
> Here is the pertinent part of my code.
>
> Set MailDoc = MailDb.CreateDocument
>
> With MailDoc
>
> .Form = "Memo"
> .SendTo = SendTo ' an array of addresses
> .CopyTo = CopyTo ' an array of addresses
> .Principal = "Something other than me"
> .Subject = Subject ' var holding subject line
> .Body = Body ' var holding body text
> .SaveMessageOnSend = True
>
> .PostedDate = Now() 'Gets the mail to appear in the sent items
> folder
> .Send False
>
> End With
>
>
> Does anyone know of a way to set the From address -- or, at least,
> make sure that it always shows the name of the sender no matter who
> opens it?
>
> Thanks.
>

Reply With Quote
  #3  
Old 08-26-2008, 11:48 PM
Default Re: Set "From address" n Notes email from VBA

For sending email from notes mail UI, there is a 'From' preset at the
memo form. Since you are using the backend mehtod, you need to update
the 'From' field as the current username.

If you check the tmpDisplaySentBy field of the Memo form, you will
find that the design will try to use current username if there are no
Form field at the document.

You may update the code as,
> Here is the pertinent part of my code.
>
> * * Set MailDoc = MailDb.CreateDocument
>
> * * With MailDoc
>
> * * * * .Form = "Memo"

.From = sess.commonusername ' where sess is the notessession
you created
> * * * * .SendTo = SendTo * * * * * * ' an array of addresses
> * * * * .CopyTo = CopyTo * * * * * * ' an array of addresses
> * * * * .Principal = "Something other than me"
> * * * * .Subject = Subject * * * * * * ' var holding subject line
> * * * * .Body = Body * * * * * * * * * *' var holding body text
> * * * * .SaveMessageOnSend = True
>
> * * * * .PostedDate = Now() 'Gets the mail to appear in the sent items
> folder
> * * * * .Send False
>
> * * End With



Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 03:16 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.