0

I have created a file transfer service that sends files from one directory to another using a file connector. This is done over FTP server. I have an email that sends out after a file has successfully transferred, however it does not work over my FTP server but it does work when I tested it locally. There are no error received, the email is just not sending.

Is there a specific way to do this using 'Mail to' with an FTP server ?

This is my email code:

<log level="custom">
                <property name="sequence" value="FileReadSeq"/>
            </log>
            <property name="messageType" scope="axis2" type="STRING" value="text/html"/>
            <property name="ContentType" scope="axis2" type="STRING" value="text/html"/>
            <property name="Subject" scope="transport" type="STRING" value="File Received"/>
            <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
            <send>
                <endpoint name="FileEpr">
                    <address uri="mailto:myemail@gmail.com">
                        <suspendOnFailure>
                            <initialDuration>-1</initialDuration>
                            <progressionFactor>1</progressionFactor>
                        </suspendOnFailure>
                        <markForSuspension>
                            <retriesBeforeSuspension>0</retriesBeforeSuspension>
                        </markForSuspension>
                    </address>
                </endpoint>
            </send>

All the configurations in the axis.xml and deployment files are there for email.

I am confused as how it works locally but not over FTP.

Deployment.toml coonfiguration code below:

[[transport.mail.sender]]
name = "mailto"
parameter.hostname = "smtp.gmail.com"
parameter.port = "587"
parameter.enable_tls = true
parameter.auth = true
parameter.username = "myemail@gmail.com"
parameter.password = "emailpassword"
parameter.from = "myemail@gmail.com"

this is the configuration in my axis.xml file:

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
        <parameter name="mail.smtp.port">587</parameter>
        <parameter name="mail.smtp.starttls.enable">true</parameter>
        <parameter name="mail.smtp.auth">true</parameter>
        <parameter name="mail.smtp.user">myemail@gmail.com</parameter>
        <parameter name="mail.smtp.password">emailpassword</parameter>
        <parameter name="mail.smtp.from">myemail@gmail.com</parameter>
    </transportSender>
  • Do you have the same configurations in your local? Can you add the configurations to the question? – ycr Nov 10 '22 at 12:22
  • Can you specify what configurations you are asking about? – Nalyssia Govender Nov 10 '22 at 12:39
  • What you added in deployment.toml, realted to mailto transport. – ycr Nov 10 '22 at 12:41
  • I have updated my post with the deployment.toml file configuration code. And yes it is the same configurations. – Nalyssia Govender Nov 10 '22 at 12:44
  • Do you have any Firewalls or Corporate Proxies preventing you from connecting to the SMTP server? – ycr Nov 10 '22 at 13:23
  • So basically, I created a FTP on one of my remote desktop connections. I want to be able to run the file transfer service with the email notification on my local desktop, but when I do run it with the ftp configurations, the files move but the email does not send out. However when I run the service on my remote desktop connection, the files move as well as the email gets sent out. I want to be able to send a email out when it runs locally as well. And to answer the Firewall question, yes everything is disabled so nothing is preventing it from connecting – Nalyssia Govender Nov 10 '22 at 13:31

0 Answers0