Using Powershell to find Lotus Notes internet email address - email

Using Powershell, I need to retrieve an Internet email address from a Lotus Notes names.nsf address book.
Within Notes, I can see the internet email address I want to retrieve. It is on the Basics tab, under the Mail section, in a field called "Internet Address". However, I have not been able to find the view it is under, or a way to query it or derive it. It would also be helpful to filter the email addresses I would like to find by the Company on the "Work/Home" tab in Lotus Notes.
Opening one of the names.nsf files in IE, I see a number of the fields I want, but a formatted internet email address isn't in there. All I see is the Lotus notes style of email address:
firstname lastname/mycompany/abc # abc
(The column name that is in is named $16).
Is there a way to pull the full internet email addresses from a Lotus Notes names.nsf address book? If so, how? If they are in some of the "hidden" views available, how do you query the values in those hidden views?
Thanks!

In many cases, the best view to use for finding Person documents is the hidden view called "$Users". It is indexed by just about every variation of the name that you can think of, so lookups just tend to work. You can find it by opening the Person document from the view and reading the NotesItem named "InternetAddress", or you can read it directly from the view column that is labled "InternetAddress", which I believe is the 17th column.

You can access all of the properties for a given user from the NAB using powershell. You must run the 32 bit version of PS if your Notes client is 32 bit. You will be prompted for your Notes ID password.
$notes=new-object -comobject Lotus.NotesSession;
$notes.Initialize("");
$ndb = $notes.getdatabase("admin","names.nsf");
$nview = $ndb.getview('($Users)');
$searchkey = "Schmoe"; #whatever
$doc =$nview.getdocumentbykey($searchkey,$true);
$mailaddress = $doc.getitemvalue('mailaddress')[0];
$internetaddress = $doc.getitemvalue('internetaddress')[0];

Related

Multiple conditional emails sent based on Google Form submission

I use the below script with a google form which sends an email to different people based on the answer chosen on the form. The script works and sends an email to the correct person when I use it with a form where the user can only choose one option.
But now I have a form where a user can choose between 1 and 6 options for the selection of cases to match. For every option chosen, I need an email to be sent to the corresponding department. With switch command, I understand that it tests an expression against a list of cases and returns the corresponding value of the first matching case. What I need is for it to test against a list of cases and return ALL corresponding values and then email based on that. Sometimes that would be one email, sometimes that could be 3 emails to 3 different people, etc.
The question on the google form is a checkbox question so a user can choose any and all if it applies. Each option correlates with a different email in my script.
Currently, if the form is filled out and only one option is chosen (see screenshot question "announcement outlet"), the script runs and sends the email as it should. But if two or more options are selected, no email goes out. When I check the trigger notes, the error is:
Exception: Failed to send email: no recipient
at sendFormByEmail(Code:47:13)
Here is my current script which works when only one option can be chosen. I believe I need a different command other than switch, but don't know what. I looked into fallthrough, but don't think that would work for this either.
function sendFormByEmail(e)
{      
// Remember to replace XYZ with your own email address  
var named_values = e.namedValues  
var teachername = named_values["Teacher Name"];    
var info = named_values["Your message/announcement"];  
var time = named_values["Please include time frame"];  
var photos = named_values["Include photos with this form if applicable; you can also create the graphic for social media and include below"];  
var announce = named_values["Choose announcement outlet"].toString();  
var email;
 
 // Optional but change the following variable  
// to have a custom subject for Google Docs emails  
  
// The variable e holds all the form values in an array.  
// Loop through the array and append values to the body.  
var message = "";      
for(var field in e.namedValues) {    
message += field + ' :: ' 
              + e.namedValues[field].toString() + "\n\n"; 
 }   
  switch (announce) {    
case "School Intercom Announcement":      
var email = "person1#school.net";      
break;    
case "MHHS Website":      
var email = "person2#school.net";      
break;    
case "MHHS Social Media (Instagram, Facebook, Twitter)":      
var email = "person3#school.net"     
break;    
case "Week in Pics":      
var email = "person4#school.net"  
var body = "Week in Pics Request"    
break;  
case "Remind text message (goes to students - please specify in your message info if it is all grades or specific grades)":
var email = "person5#school.net"
var subject = "Remind Text Request"
break;
case "Phone call home":
var email = "person6#school.net"
break;
}  
 // This is the MailApp service of Google Apps Script  
// that sends the email. You can also use GmailApp here.  
MailApp.sendEmail(email, subject, message);   
}
When multiple options are chosen, the data in the cell reads "Option 2, Option 4" and all my listed cases in the script above are for only "Option 2" or "Option 4", etc. Is there a way make this happen without having to make a case for every possible combination of the 6 choices that could potentially happen?
One way to fix the code
Remove .toString() from var announce = named_values["Choose announcement outlet"].toString();. Rationale: There is no need to convert an Array into a string for this case.
Instead of switch use if's, more specifically, add one if for each case clause, using an expression to test if the case label is included in announce. Example:
Replace
case "School Intercom Announcement":
by
if(announce.includes("School Intercom Announcement")){
// put here the case clause, don't include break;
// Add the following line before the closing `}` of the if statement
MailApp.sendEmail(email, subject, message);
}
Rationale: It's easier to implement the required control logic using if and Array.prototype.includes rather than doing it using switch.

How to get Shape Name in office 365 office.Interop.word

How can I get the exact picture name from word.Document.Shape.Name method. I tried that but it is not getting the exact name. I tried like
objWord.Document.getItem(activeWord).Shape.getItem(index).Name
But it won't get the exact name. Is there any other method to return the Logo name in a document?. Should InlineShape serve the above functionality?.
Please suggest how can I retrieve the Logo name inside a Word document. I'm using Word 2016.
The behavior you report - losing the Shape.Name when copying/pasting between documents - is to be expected. Since this is a Shape, use the Shape.AlternativeText property to store the information currently in the Shape.Name. That will come across intact.

Break down keyword in URL, then check whether the keywords exist in content page

1) Can MATLAB break down the key words in URL?
eg:http://en.wikipedia.org/wiki/Hostname,
output:wikipedia wiki Hostname
2) After the output of keywords in URL then check whether the keywords exist in the content of the page like the content below, if yes then return 1, else return 0
Contents:
Hostname From Wikipedia, the free encyclopedia Jump to: navigation, search In computer networking, a hostname (archaically nodename[1]) is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication such as the World Wide Web, e-mail or Usenet. Hostnames may be simple names consisting of a single word or phrase, or they may be structured. On the Internet, hostnames may have appended the name of a Domain Name System (DNS) domain, separated from the host-specific label by a period ("dot"). In the latter form, a hostname is also called a domain name.
Example of output:
wikipedia [1]
wiki [0]
Hostname [1]
Here is a possible solution:
str = 'http://en.wikipedia.org/wiki/Hostname'
Paragraph = 'Hostname From Wikipedia, the free encyclopedia Jump to: navigation, search In computer networking, a hostname (archaically nodename[1]) blah blah'
SplitStrings = regexp(str,'[/.]','split')
c = containers.Map;
for it = SplitStrings
c( it{1} ) = strfind(Paragraph, it{1} )
end
Issues:
You will need to find out a way of including relevant and irrelevant parts of the URL. Currently, it takes http and en as valid parts of string.
You will need to see if you want the case to be respected or not.
It is algorithmically inefficient since it is making as many passes through the data as keywords. I will think about improving on this.

How to send email to multiple addresses in range of cells that updates weekly?

I am a novice at programming. I have setup a google spreadsheet that will send a weekly email reminder to those who have upcoming assignments. The spreadsheet automatically pulls the 4 email addresses of those who are assigned each week and places them in A1, B1, A2, B2 (i.e. A1:B2). I want the script to find the 4 email addresses (that change each week) and send the same email to all four of them.
When I hardcode the cc recipients into the MailApp line, it works fine. But because the recipients list changes weekly I want to reference the cells A1:B2 instead. When I try to do that, I get an Invalid Email error. The debugger shows that var ccrecipients is picking up the right cells, but I think the problem is that it returns it as an array instead of as a string. That's as far as I'm able to reason through it.
A few snippets of my code:
var ccrecipients = sheet.getRange('A1:B2').getValues();
MailApp.sendEmail(recipients, subject, "", {htmlBody: message, cc: ccrecipients});
Thanks in advance for your help. I've relied heavily on these forums to put together the code that I have. I've always been able to find an answer, until this one. Thanks!
Your observation is almost correct, sheet.getRange('A1:B2').getValues(); return an array of arrays, something like [[A1,B1],[A2,B2]] A & B representing the values in the cells to simplify my example.
And what you need in the end is a "flat" string with all the needed recipients separated by commas "A1,B1,A2,B2".
The simplest way to do that is to flatten the whole thing,that will create a string with comma separations and that's exactly what we need.
sheet.getRange('A1:B2').getValues().toString();
That should do the trick ;-)

joomla chronoform saving data

I have a problem with chronoform.
I created my form and everything. but when people input data, sometimes it doesn't get saved, sometimes the data look strange (encrypted?), but when it's me trying the form, it always works!
here an example of the strange data:
REGISTRATION DATE 2011-02-24 - 08:24:14
NAME xjvcZiqVZOf
SURNAME mbYCUldaGCfE
CHARGE CDOWWXMGA
CARD FdaYQzKjvJRjDdHiN
PHONE fUCjEIKBOQgBdtRUcdS
EMAIL qwrelb#gzblvr.com
HOW DID YOU GET TO KNOW THE LABMOND? w2yCfW iuykmqzzrasu,[url=http://stxpmgksgwqu.com/]stxpmgksgwqu[/url], [link=http://qdchzokvtmyk.com/]qdchzokvtmyk[/link], http://fxbqxghstmyn.com/
LABMOND LEVEL 2° Livello
LOCAL OFFICE Campobasso
Any idea?
Turn on the built in captch or ReCaptcha, I bet these submissions are bots.