B4J Question [SOLVED]BAD Header for SMTP when running on a Server app

Peter Lewis

Active Member
Licensed User
Longtime User
Hi All

I am get this error on the server when running a simple SMTP function. I have tried port 465 and SSL , then HTML and now Plain Text Port 25.


this is the Code


B4X:
    Try
                      
        Dim smtp As SMTP
        smtp.Initialize("mail.***.co.za",25,"noreply@***.co.za","****","sent")
        smtp.HtmlBody = False
        smtp.UseSSL = False
        smtp.Body ="Started"
        smtp.To.Add("*****@j*****.co.za")
        smtp.Subject = "Started"
        smtp.Send
        Log("Mail Sent "&"Started")
    Catch
        Log(LastException)
    End Try

At one stage I also got an bounced email back to the address saying this


on investigation I came across this article

Re: Error 554 5.6.0 with bad header​

Please add below lines in Amavisd config file, restart Amavisd service and try again:

This I tried as I am in control of the full path including the mail server.

So now I am out of ideas. Has anyone had problems like this before.

I tried using the code in the background worker, Handler and in desperation evening in the server startup APPSTART

I have sent emails to the email address and it works and Also copied the Email address and password from my mail server and PASTED it .
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…