Hi. Thank you. 
added just one line to Pre-send Script and it worked for me: 

import jenkins.*;
import hudson.model.*;
import jenkins.model.*;

*msg.setHeader('Expiry-Date', 'Fri, 22 Jan 2016 18:00:00 +0200');*

*...*


On Wednesday, January 20, 2016 at 2:44:32 PM UTC+2, slide wrote:
>
> The easiest way to do this would be to use a presend script and add the 
> header there on the msg object, which is an instance of MimeMessage. You 
> can look at the docs for that and the presend script feature in email-ext 
> to determine what you need to do.
>
> On Wed, Jan 20, 2016, 02:30 Sinai Rijkov <[email protected] <javascript:>> 
> wrote:
>
>> Hi,
>>  I need to use Expiration date,when I'm sending email from plugin.
>>
>>
>>
>> I've found ,that i can use some plugin,where we can edit headers - 
>> *Email-ext 
>> plugin*
>> How I can use Email-ext plugin for Jenkins and add custom header, like 
>> Expiration date? 
>>
>> But any moresuggestions will be welcome. :)
>>
>>
>>
>>
>> Example: 
>>
>> Expiry-Date:  header. 
>>  
>> sendmail from CentOS: 
>>
>>
>> echo -e "Content-Type: text/plain\r\nExpiry-Date: Fri, 20 Jan 2010 
>> 18:00:00 +0200 From: [email protected] <javascript:>\r\
>> nSubject: Test\r\n\r\nTest with expiration for tomorrow 20 Jan 2016" | 
>> sendmail -f [email protected] <javascript:>  [email protected] 
>> <javascript:>
>>
>>
>> So at Outlook you can see like this: 
>>
>>
>>
>> [image: Inline image 1]
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/213adcaa-4c61-4bee-8b5b-906eb65682ae%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/213adcaa-4c61-4bee-8b5b-906eb65682ae%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/29b87e08-361f-4bc9-8ef4-1b0b1c604020%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to