NMH API: how to write a script to send a message that is in a draft folder? - email

I'm trying to use nmh's "draftfolder" feature to queue outgoing mail for later delivery.
The key step I don't know how to implement is how to write a program that will send a message from a draft folder.
Here's the workflow I'm trying to achieve:
I compose a message using the comp or repl programs, and I quit with the message unsent, leaving it in the "draft folder" +delay4.
Sometime after four hours have elapsed, a cron job comes along and sends the message, removing it from the draft folder.
Here are the difficulties I'm having with existing MH commands
The comp -use command can send an existing message from a draft folder, but it requires interaction. I want to do this noninteractively from a cron job, and I'd prefer not to try to write an expect script. I tried
comp -use -noedit -nowhatnowproc
but that did not send the message. I don't know if some kind of alternate whatnow program would do the trick.
The send and post commands look promising, but both expect to operate on files, not messages in folders. Maybe send followed by rmm works, maybe it doesn't.
I could go direct to sendmail, but then I would have to figure out whether to run mhbuild or not. And I would seem to have the same issue of needing to remove the message from the folder.
My question is how can I use the MH API in a script to send a message that is sitting in a draft folder?

RTFM.
The send command's -draftfolder option makes it work on messages, not files.
Perfect for what I want. If you want to be extra explicit, use the -draftmessage option as well.

Related

powershell - link to attached file in mail message

I can't find the solution for my problem. So, in my send-mailmessage html body is field that should be redirected to file which is included as attachment in message. How can I create hyperlink to that file in mail, when client opens it?
I don't know if you get my idea. In other words, in message I have attached file, and then there is field which should be a hyperlink to attached file. When client receives message he/she should press the link and then attached file opens.
I searched almost everything in everwhere but can't find a appropriate solution how to solve this.
This isn't really a PowerShell question, since this issue has nothing to do with the functionality of the Send-MailMessage cmdlet.
In any case, the reason you can't find a solution anywhere is that what you're trying to do is impossible. There is no way that a hyperlink in an e-mail message can point to a file attached to that message. Different mail clients on different operating systems store attachments in different locations. Even if you want to assume that all your recipients are running Outlook on Windows, there are different versions of both. Even if you know for a fact that all recipients are running a specific version of Outlook on a specific version of Windows, you're still out of luck. Outlook stores attachments in a subfolder in the Temporary Internet Files in the user's profile that has a randomly generated name. There's no way to inject code into a hyperlink in an email message, so without knowing the exact local file location, you can't link to it.
I suppose if you're really determined you could have the hyperlink point to a web page that runs some complex javascript code that tries to figure out where the attachment is stored, but that's a major undertaking, and would break if the recipient's default browser has javascript disabled.
Which begs the question, why exactly are you trying to do this? So that recipients can click once instead of having to double-click to open the attachment?
I have found that you can make a hyperlink point to a file share that you know the recipients have access to.
To do so:
Simply make each hyperlink point to the specific file and there you have it.
They have to have permissions to access that file share, or there is a much better way now that I haven't thought of.
Oh well, this works for me, for now.

Coldfusion 9 - respool mail

I had a bunch of mail to be sent out that was not. I realized that my mail settings in Coldfusion Administrator were incorrect and have since corrected them. I tested the new settings with new mail and they work. I am now trying to re-send out the messages in the spool, but they go right back in the undelivered mail spool. I'm assuming that they are still using the old mail settings. Is there any way to force them to send out using the new current settings?
You'll need to edit the individual spool files, as they most likely have the mail server information in the file itself. If you open a few of the files in your badmail directory, you should be able to locate the server information and adjust accordingly.
If you can do a bulk find/replace on the files, it should make short work of it.

Can Jenkins send more than one email?

After the build I want to trigger two e-mails.
The first one is an email to SharePoint server. SharePoint uploads its attachments. The subject of this mail must match a SharePoint folder for uploading.
The second one is a mail for team. So, it should have nice subject rather than folder name.
How can I make Jenkins send two emails?
There is no plugin that provides this functionality. You have two choices to accomplish this functionality. You could implement your own plugin. A good place to start would probably be the email-ext plugin.
Alternatively, you could trigger the first email with the actual build and then have Jenkins trigger a separate, dummy build that sends the second email. This wouldn't be as elegant, but much easier as you wouldn't need to implement any functionality yourself. Depending on what exactly you want the emails to contain, you might have to transfer some data from the first to the second build (e.g. via a parameterized build).
A cheap alternative is to create "shell script" Build steps, e.g.: (if on *nix platforms)
echo "Please Mr. SharePoint, would you be so kind to attach my file(s) ?
Thanks!" | mail -s "<folder name>" -a ${WORKSPACE}/target/artifacts/myfile sharepoint#example.com
You can also add a new trigger and have the option to send a new email with new content to the recipient list.

Can Jenkins send email taking recepients from a checked out file?

I'm quite a new to Jenkins and I'm stuck trying to configure Jenkins to send email based on a file from checked out files.
Basically, I'm checking possibility to migrate our own build system scripts to run under Jenkins. One of the existing requirements is storing project maintainers' emails in a txt file in the repository. Out of the box Jenkins couldn't do that, perhaps some plugin can do the trick?
It would be great if somehow Jenkins (maybe through some plugin?) could send emails based on the information from checked out copy of repository.
Any help, information or a direction of search would be greatly appreciated.
Maybe with the Email Ext plugin which allows you to configure many many things about email :
Triggers - Select the conditions that should cause an email notification to be sent.
Content - Specify the content of each triggered email's subject and body.
Recipients - Specify who should receive a email when it is triggered.
I didn't find the option to directly take the recipient list from a source file, but you can extend easliy this plugin with Groovy or Jelly scripts.

Email sent by SAP Workflow has partial Web hyperlink

I think this might be a simple question but I cannot seem to figure it out.
I have a workflow which simply sends a mail. In the content of the mail I
have a hyperlink going back to our SAP CRM system. I pass some parameters to this hyperlink.
The workflow works fine and the email is sent, however, the hyperlink goes onto the second line of the mail and becomes in active. If I copy the entire hyperlink and paste it in a browser it works.
The issue is I don't want users to copy and paste, I simply want them to click on the hyperlink.
Here is a screen print of what I am talking about
http://img402.imageshack.us/img402/9471/38348167.png
And here is a screen print of the actual email that is sent:
http://img210.imageshack.us/img210/6424/14370746.png
I tried going into transaction PFTC (Task Maintain) I entered my task and opened it up. I went to the tab description
and hit the edit button and I changed the tag column to continuous text but that didnt work, and then I tried extended line
and that too didn't make a difference.
Here is a screen shot of that:
http://img341.imageshack.us/img341/6254/37776438.png
My question is, is there any way to get the hyperlink on one line or even to have it be clickable on 2 lines?
Thanks so much.
From what I can see, that's a limitation of SAPconnect when sending plain-text emails. You could reconfigure the system to send HTML mails, but this would affect EVERY outgoing mail and should be handled extremely cautious. I'd suggest you write a small class to assemble and send the HTML mail and call it from the step. I'd use the BCS for sending the mail - it has an excellent online documentation and comes with several demo programs (BCS_EXAMPLE_*). You could assemble the HTML body using ABAP, although this usually yields rather messy code. Cleaner ways of ding this would be to either put all of the input data into a structure and use a simple transformation or dynamic documents (see for example report DD_ADD_LINK).