You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sonam Chauhan <so...@gmail.com> on 2011/03/22 00:19:54 UTC

SMTP sampler woes

I've been trying without success to get the JMeter SMTP sampler  to
simulate sending email  to a system which receives emails in
particular format. I basically need it to send a multipart MIME email,
containing a single part (content type 'text/plain') with an XML
document. (Please see example below).

Depending on the options used, the JMeter SMTP sampler  seems to
either not send a multipart message, or base-64 encode the XML
document --  the receiving system cannot handle this.

Is there any way to just specify the full body of the email, including
headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
below?

Regards
Sonam

EXAMPLE
-----------------------------------------------
To: example@example.com
Subject: xyz
Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
Date: 16 Mar 2011 19:28:00 +1100

This is a multi-part message in MIME format.
-------7D81B75CCC90D2974F7A1CBD
Content-Type: text/plain
Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"

<XML> <a/><b/><c/>...
</XML>

-------7D81B75CCC90D2974F7A1CBD--

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: SMTP sampler woes

Posted by Sonam Chauhan <so...@gmail.com>.
Please ignore my advice below about WireShark! I later found that just
ticking 'Enable debug logging' at the bottom of the SMTP sampler causes the
entire SMTP protocol conversation (i.e. "MAIL FROM .. /RCPT TO ..
/DATA...") to be dumped to the JMeter command line/ stdout.

Regards
sonam


On Wed, Mar 23, 2011 at 3:13 PM, Sonam Chauhan <so...@gmail.com> wrote:

> Hello:
> Just for future reference, here is how (according to WireShark, a network
> sniffer) JMeter modified my '.eml' file while sending it to the SMTP server
> (modified headers marked with ">>>").
>
> Thanks again Sebb!
> -----------------------------------------------
> To: example@example.com
> >>>Subject: SPECIFIED_IN_SAMPLER
>
> Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
> Date: 16 Mar 2011 19:28:00 +1100
> >>>From: SPECIFIED_IN_SAMPLER@example.com
> >>>MIME-Version: 1.0
>
> This is a multi-part message in MIME format.
> -------7D81B75CCC90D2974F7A1CBD
> Content-Type: text/plain
> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
>
> <XML> <a/><b/><c/>...
> </XML>
>
> -------7D81B75CCC90D2974F7A1CBD--
>
>
>
>
>
>
>
>
> On Wed, Mar 23, 2011 at 1:04 PM, Sonam Chauhan <so...@gmail.com> wrote:
>
>> > Have you tried:
>> >
>> > "Send .eml"     If set, the .eml file will be sent instead of the
>> entries
>> > in the Subject, Message, and Attached files
>>
>> Thanks Sebb! I created one and it worked!
>>
>> This was the one thing I hadn't tried as I thought '.eml' files were
>> Outlook-specific. I see now  the .eml format is basically the
>> RFC822  email standard format.
>>
>> Some caveats:
>>
>>    1. Contrary to the documentation, the "Subject:" line in the .eml file
>>    is ignored by the sampler.
>>    The "Subject:" field of the sampler is always used.
>>    2. It would be good clarifying in the documentation that the .eml file
>>    format is the standard RFC822 format.
>>    3. Offtopic, but for anyone trying this in future -- avoid using your
>>    own company's email servers  - they may 'rewrite' inbound emails. Its better
>>    sending test emails to a Gmail account, opening the message and choosing
>>    "Show Original" (in  options dropdown, next to "Reply"). I also had to use
>>    WireShark to verify what JMeter was doing.
>>
>> Regards
>> Sonam
>>
>>
>> On Wed, Mar 23, 2011 at 5:17 AM, sebb <se...@gmail.com> wrote:
>> > Have you tried:
>> >
>> > "Send .eml"     If set, the .eml file will be sent instead of the
>> entries
>> > in the Subject, Message, and Attached files
>> >
>> > On 22 March 2011 04:34, Sonam Chauhan <so...@gmail.com> wrote:
>> >>> Which version of JMeter are you using?
>> >>
>> >> The latest, 2.4 (just downloaded it yesterday :)
>> >>
>> >> Sonam
>> >>
>> >> On Tue, Mar 22, 2011 at 10:23 AM, sebb <se...@gmail.com> wrote:
>> >>> On 21 March 2011 23:19, Sonam Chauhan <so...@gmail.com> wrote:
>> >>>> I've been trying without success to get the JMeter SMTP sampler  to
>> >>>> simulate sending email  to a system which receives emails in
>> >>>> particular format. I basically need it to send a multipart MIME
>> email,
>> >>>> containing a single part (content type 'text/plain') with an XML
>> >>>> document. (Please see example below).
>> >>>>
>> >>>> Depending on the options used, the JMeter SMTP sampler  seems to
>> >>>> either not send a multipart message, or base-64 encode the XML
>> >>>> document --  the receiving system cannot handle this.
>> >>>>
>> >>>> Is there any way to just specify the full body of the email,
>> including
>> >>>> headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
>> >>>> below?
>> >>>
>> >>> Which version of JMeter are you using?
>> >>>
>> >>>> Regards
>> >>>> Sonam
>> >>>>
>> >>>> EXAMPLE
>> >>>> -----------------------------------------------
>> >>>> To: example@example.com
>> >>>> Subject: xyz
>> >>>> Content-Type: multipart/mixed;
>> boundary="-----7D81B75CCC90D2974F7A1CBD"
>> >>>> Date: 16 Mar 2011 19:28:00 +1100
>> >>>>
>> >>>> This is a multi-part message in MIME format.
>> >>>> -------7D81B75CCC90D2974F7A1CBD
>> >>>> Content-Type: text/plain
>> >>>> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
>> >>>>
>> >>>> <XML> <a/><b/><c/>...
>> >>>> </XML>
>> >>>>
>> >>>> -------7D81B75CCC90D2974F7A1CBD--
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> >>>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>> >>>>
>> >>>>
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> >>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>> >>>
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>> >
>> >
>>
>>
>

Re: SMTP sampler woes

Posted by Sonam Chauhan <so...@gmail.com>.
Hello:
Just for future reference, here is how (according to WireShark, a network
sniffer) JMeter modified my '.eml' file while sending it to the SMTP server
(modified headers marked with ">>>").

Thanks again Sebb!
-----------------------------------------------
To: example@example.com
>>>Subject: SPECIFIED_IN_SAMPLER
Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
Date: 16 Mar 2011 19:28:00 +1100
>>>From: SPECIFIED_IN_SAMPLER@example.com
>>>MIME-Version: 1.0

This is a multi-part message in MIME format.
-------7D81B75CCC90D2974F7A1CBD
Content-Type: text/plain
Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"

<XML> <a/><b/><c/>...
</XML>

-------7D81B75CCC90D2974F7A1CBD--








On Wed, Mar 23, 2011 at 1:04 PM, Sonam Chauhan <so...@gmail.com> wrote:

> > Have you tried:
> >
> > "Send .eml"     If set, the .eml file will be sent instead of the entries
> > in the Subject, Message, and Attached files
>
> Thanks Sebb! I created one and it worked!
>
> This was the one thing I hadn't tried as I thought '.eml' files were
> Outlook-specific. I see now  the .eml format is basically the
> RFC822  email standard format.
>
> Some caveats:
>
>    1. Contrary to the documentation, the "Subject:" line in the .eml file
>    is ignored by the sampler.
>    The "Subject:" field of the sampler is always used.
>    2. It would be good clarifying in the documentation that the .eml file
>    format is the standard RFC822 format.
>    3. Offtopic, but for anyone trying this in future -- avoid using your
>    own company's email servers  - they may 'rewrite' inbound emails. Its better
>    sending test emails to a Gmail account, opening the message and choosing
>    "Show Original" (in  options dropdown, next to "Reply"). I also had to use
>    WireShark to verify what JMeter was doing.
>
> Regards
> Sonam
>
>
> On Wed, Mar 23, 2011 at 5:17 AM, sebb <se...@gmail.com> wrote:
> > Have you tried:
> >
> > "Send .eml"     If set, the .eml file will be sent instead of the entries
> > in the Subject, Message, and Attached files
> >
> > On 22 March 2011 04:34, Sonam Chauhan <so...@gmail.com> wrote:
> >>> Which version of JMeter are you using?
> >>
> >> The latest, 2.4 (just downloaded it yesterday :)
> >>
> >> Sonam
> >>
> >> On Tue, Mar 22, 2011 at 10:23 AM, sebb <se...@gmail.com> wrote:
> >>> On 21 March 2011 23:19, Sonam Chauhan <so...@gmail.com> wrote:
> >>>> I've been trying without success to get the JMeter SMTP sampler  to
> >>>> simulate sending email  to a system which receives emails in
> >>>> particular format. I basically need it to send a multipart MIME email,
> >>>> containing a single part (content type 'text/plain') with an XML
> >>>> document. (Please see example below).
> >>>>
> >>>> Depending on the options used, the JMeter SMTP sampler  seems to
> >>>> either not send a multipart message, or base-64 encode the XML
> >>>> document --  the receiving system cannot handle this.
> >>>>
> >>>> Is there any way to just specify the full body of the email, including
> >>>> headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
> >>>> below?
> >>>
> >>> Which version of JMeter are you using?
> >>>
> >>>> Regards
> >>>> Sonam
> >>>>
> >>>> EXAMPLE
> >>>> -----------------------------------------------
> >>>> To: example@example.com
> >>>> Subject: xyz
> >>>> Content-Type: multipart/mixed;
> boundary="-----7D81B75CCC90D2974F7A1CBD"
> >>>> Date: 16 Mar 2011 19:28:00 +1100
> >>>>
> >>>> This is a multi-part message in MIME format.
> >>>> -------7D81B75CCC90D2974F7A1CBD
> >>>> Content-Type: text/plain
> >>>> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
> >>>>
> >>>> <XML> <a/><b/><c/>...
> >>>> </XML>
> >>>>
> >>>> -------7D81B75CCC90D2974F7A1CBD--
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>

Re: SMTP sampler woes

Posted by Sonam Chauhan <so...@gmail.com>.
> Have you tried:
>
> "Send .eml"     If set, the .eml file will be sent instead of the entries
> in the Subject, Message, and Attached files

Thanks Sebb! I created one and it worked!

This was the one thing I hadn't tried as I thought '.eml' files were
Outlook-specific. I see now  the .eml format is basically the
RFC822  email standard format.

Some caveats:

   1. Contrary to the documentation, the "Subject:" line in the .eml file is
   ignored by the sampler.
   The "Subject:" field of the sampler is always used.
   2. It would be good clarifying in the documentation that the .eml file
   format is the standard RFC822 format.
   3. Offtopic, but for anyone trying this in future -- avoid using your own
   company's email servers  - they may 'rewrite' inbound emails. Its better
   sending test emails to a Gmail account, opening the message and choosing
   "Show Original" (in  options dropdown, next to "Reply"). I also had to use
   WireShark to verify what JMeter was doing.

Regards
Sonam


On Wed, Mar 23, 2011 at 5:17 AM, sebb <se...@gmail.com> wrote:
> Have you tried:
>
> "Send .eml"     If set, the .eml file will be sent instead of the entries
> in the Subject, Message, and Attached files
>
> On 22 March 2011 04:34, Sonam Chauhan <so...@gmail.com> wrote:
>>> Which version of JMeter are you using?
>>
>> The latest, 2.4 (just downloaded it yesterday :)
>>
>> Sonam
>>
>> On Tue, Mar 22, 2011 at 10:23 AM, sebb <se...@gmail.com> wrote:
>>> On 21 March 2011 23:19, Sonam Chauhan <so...@gmail.com> wrote:
>>>> I've been trying without success to get the JMeter SMTP sampler  to
>>>> simulate sending email  to a system which receives emails in
>>>> particular format. I basically need it to send a multipart MIME email,
>>>> containing a single part (content type 'text/plain') with an XML
>>>> document. (Please see example below).
>>>>
>>>> Depending on the options used, the JMeter SMTP sampler  seems to
>>>> either not send a multipart message, or base-64 encode the XML
>>>> document --  the receiving system cannot handle this.
>>>>
>>>> Is there any way to just specify the full body of the email, including
>>>> headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
>>>> below?
>>>
>>> Which version of JMeter are you using?
>>>
>>>> Regards
>>>> Sonam
>>>>
>>>> EXAMPLE
>>>> -----------------------------------------------
>>>> To: example@example.com
>>>> Subject: xyz
>>>> Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
>>>> Date: 16 Mar 2011 19:28:00 +1100
>>>>
>>>> This is a multi-part message in MIME format.
>>>> -------7D81B75CCC90D2974F7A1CBD
>>>> Content-Type: text/plain
>>>> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
>>>>
>>>> <XML> <a/><b/><c/>...
>>>> </XML>
>>>>
>>>> -------7D81B75CCC90D2974F7A1CBD--
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: SMTP sampler woes

Posted by sebb <se...@gmail.com>.
Have you tried:

"Send .eml" 	If set, the .eml file will be sent instead of the entries
in the Subject, Message, and Attached files

On 22 March 2011 04:34, Sonam Chauhan <so...@gmail.com> wrote:
>> Which version of JMeter are you using?
>
> The latest, 2.4 (just downloaded it yesterday :)
>
> Sonam
>
> On Tue, Mar 22, 2011 at 10:23 AM, sebb <se...@gmail.com> wrote:
>> On 21 March 2011 23:19, Sonam Chauhan <so...@gmail.com> wrote:
>>> I've been trying without success to get the JMeter SMTP sampler  to
>>> simulate sending email  to a system which receives emails in
>>> particular format. I basically need it to send a multipart MIME email,
>>> containing a single part (content type 'text/plain') with an XML
>>> document. (Please see example below).
>>>
>>> Depending on the options used, the JMeter SMTP sampler  seems to
>>> either not send a multipart message, or base-64 encode the XML
>>> document --  the receiving system cannot handle this.
>>>
>>> Is there any way to just specify the full body of the email, including
>>> headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
>>> below?
>>
>> Which version of JMeter are you using?
>>
>>> Regards
>>> Sonam
>>>
>>> EXAMPLE
>>> -----------------------------------------------
>>> To: example@example.com
>>> Subject: xyz
>>> Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
>>> Date: 16 Mar 2011 19:28:00 +1100
>>>
>>> This is a multi-part message in MIME format.
>>> -------7D81B75CCC90D2974F7A1CBD
>>> Content-Type: text/plain
>>> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
>>>
>>> <XML> <a/><b/><c/>...
>>> </XML>
>>>
>>> -------7D81B75CCC90D2974F7A1CBD--
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: SMTP sampler woes

Posted by Sonam Chauhan <so...@gmail.com>.
> Which version of JMeter are you using?

The latest, 2.4 (just downloaded it yesterday :)

Sonam

On Tue, Mar 22, 2011 at 10:23 AM, sebb <se...@gmail.com> wrote:
> On 21 March 2011 23:19, Sonam Chauhan <so...@gmail.com> wrote:
>> I've been trying without success to get the JMeter SMTP sampler  to
>> simulate sending email  to a system which receives emails in
>> particular format. I basically need it to send a multipart MIME email,
>> containing a single part (content type 'text/plain') with an XML
>> document. (Please see example below).
>>
>> Depending on the options used, the JMeter SMTP sampler  seems to
>> either not send a multipart message, or base-64 encode the XML
>> document --  the receiving system cannot handle this.
>>
>> Is there any way to just specify the full body of the email, including
>> headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
>> below?
>
> Which version of JMeter are you using?
>
>> Regards
>> Sonam
>>
>> EXAMPLE
>> -----------------------------------------------
>> To: example@example.com
>> Subject: xyz
>> Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
>> Date: 16 Mar 2011 19:28:00 +1100
>>
>> This is a multi-part message in MIME format.
>> -------7D81B75CCC90D2974F7A1CBD
>> Content-Type: text/plain
>> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
>>
>> <XML> <a/><b/><c/>...
>> </XML>
>>
>> -------7D81B75CCC90D2974F7A1CBD--
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: SMTP sampler woes

Posted by sebb <se...@gmail.com>.
On 21 March 2011 23:19, Sonam Chauhan <so...@gmail.com> wrote:
> I've been trying without success to get the JMeter SMTP sampler  to
> simulate sending email  to a system which receives emails in
> particular format. I basically need it to send a multipart MIME email,
> containing a single part (content type 'text/plain') with an XML
> document. (Please see example below).
>
> Depending on the options used, the JMeter SMTP sampler  seems to
> either not send a multipart message, or base-64 encode the XML
> document --  the receiving system cannot handle this.
>
> Is there any way to just specify the full body of the email, including
> headers?  i.e. Can the SMTP sampler  send an  email exactly as shown
> below?

Which version of JMeter are you using?

> Regards
> Sonam
>
> EXAMPLE
> -----------------------------------------------
> To: example@example.com
> Subject: xyz
> Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
> Date: 16 Mar 2011 19:28:00 +1100
>
> This is a multi-part message in MIME format.
> -------7D81B75CCC90D2974F7A1CBD
> Content-Type: text/plain
> Content-Disposition: attachment; filename="POC_PO_SUBMISSION.XML"
>
> <XML> <a/><b/><c/>...
> </XML>
>
> -------7D81B75CCC90D2974F7A1CBD--
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org