Service Virtualization

  • 1.  Send Email Step not working

    Posted 02-15-2017 02:07 AM

    While running a suite the "send email step's" port number is automatically updated to 0 and it throws an error stating : 

    "Cannot connect to a port number that is less than 1(0)"

    Failed to send email,

    Error message = Cannot connect to a port number that is less than 1 ( 0 ) ============================================================================

    | Step: Send Email Step ----------------------------------------------------------------------------|

    | Message: Cannot connect to a port number that is less than 1 ( 0 ) ----------------------------------------------------------------------------|

    | Trapped Exception: Cannot connect to a port number that is less than 1 ( 0 )

    | Trapped Message: java.lang.IllegalArgumentException: Cannot connect to a port number that is less than 1 ( 0 )



  • 2.  Re: Send Email Step not working

    Broadcom Employee
    Posted 02-15-2017 02:29 PM

    How did you define your Email Connection Asset?



  • 3.  Re: Send Email Step not working

    Posted 02-15-2017 10:56 PM
    • I have given the address of my SMTP Email Server.
    • Security is None.
    • Authentication is off.

    So, It should take the port as 25, by default(according to the documentation)

     

    Before running the test suite, port number "0" is not even in the port list. But when I run the suite, port number is automatically updated to "0".

    This process is taking place randomly, as in, some times it works perfectly fine (with port number 25) and some times it updates the port number to "0" and gives me the error : Can not accept port number less than 1(0).



  • 4.  Re: Send Email Step not working

    Broadcom Employee
    Posted 02-22-2017 02:18 PM

    What version of DevTest are you on?

     

    This is an example on DevTest 9.5.1:

     

    Below is my email Asset and I verify my information ( I choose PRO button first to see the Scope, then choose the arrow in the green icon):

     

     

    What do you get when you verify your information?



  • 5.  Re: Send Email Step not working

    Posted 05-31-2017 06:56 AM

    Hey Marcy and all

     

    I'm getting the Verifying Asset success, when I click verify. However when I click Send Test Email, I'm getting the below error:

     

    Can someone help please.

    org.apache.commons.mail.EmailException: Sending the email to the following server failed : https://outlook.office365.com:25
    at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410)
    at org.apache.commons.mail.Email.send(Email.java:1437)
    at com.itko.lisa.glass.SendEmailExecutor.sendEmail(SendEmailExecutor.java:136)
    at com.itko.lisa.glass.SendEmailStepEditor$2.actionPerformed(SendEmailStepEditor.java:286)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Caused by: javax.mail.MessagingException: Unknown SMTP host: https://outlook.office365.com;
    nested exception is:
    java.net.UnknownHostException: https://outlook.office365.com
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1959)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
    at javax.mail.Service.connect(Service.java:295)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400)
    ... 40 more
    Caused by: java.net.UnknownHostException: https://outlook.office365.com
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:237)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
    ... 47 more



  • 6.  Re: Send Email Step not working

    Posted 02-24-2017 09:30 AM

    Did Marcy response with an example in 9.5.1 help you out?

     

    Regards,

    Reid



  • 7.  Re: Send Email Step not working
    Best Answer

    Posted 05-28-2017 07:35 AM

    Hi,

     

    I am working on DevTest version 10.

    Thanks for your answers, but, I figured out the way to make it work.

    Actually, My port number was automatically getting switched to "0".So, I defined the property for port and gave it the value of "25" & used the property name instead of numerical value "25". Now it is working fine.

     

    Thanks for the help.

     

    I am having some other problem now. I want to send an image through the send e-mail step and I don't want to send the image as an attachment, instead I want to send the image as the background image of the e-mail body.

    The documentation says that I can use the bufferedimage as the property to embed the image in the body and I have no idea how to do that.

    Please help.



  • 8.  Re: Send Email Step not working

    Broadcom Employee
    Posted 05-29-2017 03:35 AM

    Hi Shubham,

        We discussed on this issue in support case and used below sample script in e-mail body to send email email with an image in email body.

    Sample script used:

         <!DOCTYPE html>
    <html>
    <body background="C:\Chrysanthemum.jpg">
    <h1>Hello world!</h1>
    <p><a href="https://www.w3schools.com">Visit W3Schools.com!</a></p>
    <p>The background attribute is not supported HTML5. Use CSS instead.</p>
    </body>
    </html>

     

    Thanks

    Srikanth



  • 9.  Re: Send Email Step not working

    Posted 05-30-2017 06:27 AM

    Hi Srikanth, thanks for the help.

    Can we add external CSS to it? If yes do we have to add the CSS file also on the global drive just like we did with the image?