Sending an email with a custom “sender” with Lotus Notes/Domino

Share

I recently had the need to send an email from a Notes application where the sender wasn’t going to be me, nor the agen’t signer.   I tried many methods I’d found on the forums, on the many articles, on help from twitter, and finally, by opening a PMR with Lotus support, only to be told that IBM/Lotus won’t help me because it is spoofing.

I am not spoofing anything. I have a legitimate business need to send out emails, where there is no mention of the user performing the action, nor the signer of an agent, nor the server’s id either.

If I set the mail document’s fields, nothing should be changing them.

e.g.
Dim mysender As String, mysenderN As String
mysender = "emaillistedinNAB@myinetdomain.com"
mysenderN = mysender & "@NotesDomain" 'Needed for internal routing only
maildoc.From = mysenderN
maildoc.SMTPOriginator = mysender
maildoc.Sender = mysender
maildoc.Principal = mysenderN
maildoc.INETFROM = mysender
...
maildoc.send (true,false)

If I stop the router, and look at the document in the mail.box, the INETFROM shouldn’t be different, but it is, and it is my email address, well, the address associated with my .id file.

I see far too many posts and things about this in the forums.  I’ve looked and looked, but couldn’t spot how to accomplish this.  Well, I finally read it somewhere, and I can’t remember where, but put simply, if you are working in the mail.box, don’t use the “send” method, simply use the “save” method, and voilà, the mail will leave how you programmed it.

This is my example code for sending a MIME email, with a “spoofed” sender using Lotus Notes/Domino 8.5. Is it perfect – no, but it does work for me…

Dim s As New NotesSession Dim Subject As String, SendTo As String Dim Sender As String, SenderN As String 'the address you want the mail to appear to be from Sender = "FName LName <flname@domain.com>" SenderN = "FName LName <flname@domain.com@NotesDomain>" 'Alternatively, you could just use: 'Sender = "flname@domain.com" 'SenderN = Sender & "@NotesDomain" subject = "This is the subject line" SendTo = "someone@somedomain.com" Dim DBmbox As New NotesDatabase("servername", "mail.box") Dim mail As New NotesDocument( DBmbox ) s.ConvertMIME = False ' Do not convert MIME to rich text Dim body As NotesMIMEEntity Dim header As NotesMIMEHeader Dim stream As NotesStream Dim child As NotesMIMEEntity Set stream = s.CreateStream Set body = mail.CreateMIMEEntity Set header = body.CreateHeader({MIME-Version}) Call header.SetHeaderVal("1.0") Set header = body.CreateHeader("Content-Type") Call header.SetHeaderValAndParams({multipart/alternative;boundary="=NextPart_="}) 'Add the to field Set header = body.CreateHeader("To") Call header.SetHeaderVal(SendTo) 'Add Subject Line Set header = body.CreateHeader("Subject") Call header.SetHeaderVal(subject) 'Add the body of the message Set child = body.CreateChildEntity Call stream.WriteText("<p>") Call stream.WriteText("<font face=Verdana color=#0288C1 size=3>") Call stream.WriteText(|<div class="headerlogo">|) 'If you are referencing any external files, images, javascript, you must use a fully qualified URL/Path Call stream.WriteText (|<img src="https://yourserver.com/images/somelogo.gif" alt="SomeLogo">|) Call stream.WriteText(|</div></font>|) Call stream.WriteText(|...some more HTML |) Call child.setContentFromText(stream, {text/html;charset="iso-8859-1"}, ENC_NONE) Call stream.Truncate 'Not sure if I need this Call stream.Close Call mail.CloseMIMEEntities(True) Call mail.replaceItemValue("Form", "Memo") Call mail.replaceItemValue("Recipients", SendTo) Call mail.replaceItemValue( "From", SenderN ) Call mail.replaceItemValue( "InetFrom", Sender ) 'Since we created the mail in the mail.box, we just need to save it, not send it! Call mail.Save(True,False) s.ConvertMIME = True ' Restore conversion
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
Share

From outside the Lotus Yellow Bubble

Share

Outside the Lotus Yellow BubbleAfter reading Bruce Elgort’s blog entry, and Ed Brill’s response I felt compelled to write as a person outside the yellow bubble.  I am not a business partner, ISV, VAR or any other acronym, I am C1SQ5EN (sorry, bad download site joke there) – simply a customer, user, designer and administrator of Lotus Domino, Notes, Sametime and now Quickr.  The message I am getting from these recent posts is that there is certainly some recognized turmoil in the Lotii ranks. My question is how will IBM/Lotus react, and by that, I don’t just mean Ed Brill.

Ed’s response goes a long way to at least explaining things, but one of the most vocal complaint I’ve seen as of late, is about the download sites.   First and foremost, I agree, as does Ed seem to, that they are horrible.  But the “it isn’t my department” response I seem to be hearing doesn’t bode well with what I saw at the Lotusphere comes to you event in  Palisades, NY yesterday.

Where is the guy or gal’s connections profile that says they are in the download site department?  Why can’t Ed ping them on Sametime, and talk to them on the UC2 technology?  Where are all the dogear links to the people complaining about this issue?  Maybe all this exists, but I just don’t see IBM practicing what they preach in this arena.

As for the the LCTY event as a whole – it was very good, but I question why there were only four business partners sharing two small card tables on hand.  Was this their way of protest?  I can’t imagine, that in the NY Metro Area only four of them were there.

The lab setup was good.  I had a nice discussion with Brendan O’Sullivan about Sametime, and spent some time with a few others there as well.  Good stuff there!

One other comment I overheard and found a bit off-putting was “there is only one door prize with this many people?”.  If you were there just for the give-aways, or as a nice day away from your office, with a somewhat extravagant lunch (that was a little overboard IBM!), I hope you get fired. There are plenty of people that would be more than happy to be employed and actually giving a shit.  Speaking of that, I really enjoy using that term lately thanks to this excellenet blog entry).

Yes, it would have been nice to win a little flip video camera but I see these events as a way to get to speak with people I certainly normally wouldn’t have access to otherwise and that is what I did.  The demos and presentations – 99% is online somewhere.

</rant>

[print_link]

Share

Upgrading to Lotus Domino 8.5

Share

Lotus Domino Server IconWell, it is finally here (for me), probably one of the biggest upgrades to Lotus Notes since the introduction of the “Domino” moniker back when I was still running it on OS/2.  OK, the 8.x release came out months ago but was missing a key feature that we use (roaming) but the “Gold” 8.5 release came out a few days ago, which put that feature back in.

So tonight is my upgrade of our primary production server to it.  I’ve been a Notes Developer/Admin/User since version 3 and wow has this come a long way since then.  Uber significant UI and functionality changes in the client really shine, never mind the ID vault and things like DAOS on the admin front.

Upgrades to new version of Lotus Domino have always proven way to simple (finding a large piece of wood to knock on) and as tested, this one should be no different.  I’ve done upgrades as a consultant to a certain other mail server and it was much more painful to me.  Am I against Microsoft Exchange, no, and as just a mail/calendar type server, it is fine, but for the way we use Notes here, doing it in the Microsoft world would be a massive undertaking of all sorts of other servers and applications.

People who “get” Notes, love it, and therein lies the problem – getting people to “get” it.  When IBM took over the Lotus brand, I didn’t expect the marketing to get better, and sorry IBM, but you have thus far proven to meet that expectation.

On a recent tweet by @chrismarquardt, he asked about year planner software for a Mac to which I said, “Lotus Notes is very happy on Macs these days” and his reply, “Lotus Notes? I had almost successfully forgotten it” and my reply, “You’d probably be surprised at what you see. IBM/Lotus made a rather large announcement at Macworld [2009]”.  After that, a few responses about how people hate Notes, wishing they never had to use it and other general derogatory remarks about it, my favorite, “Lotus Notes? Please do not mention it!! *&%$+” which just furthers my point about the lack of understanding of an otherwise great piece of software.

Do I work for IBM, nope, am I paid to say these things, nope, do they sponsor this site, nope – call me a Lotus fanboy if you like, but me, I like things that just work, and my Notes setup does just that.
Have a look at some other type of Lotus Fans.

[print_link]

Share