Android Question SMTP - Send PDF with Content-Type error

Discussion in 'Android Questions' started by cocale2001, May 25, 2015.

  1. cocale2001

    cocale2001 Member Licensed User

    Hi .i use SMTP lib.
    Sending a message with an attached PDF file . In the mailbox I get the message with the PDF file encoded in base 64 and unreadable
    I think is the wrong Content- Type. Is it possible to force the Content-Type right?
    See the example below:

    This is a boby and is OK
    Content-Type: text/plain; charset="utf-8"

    Invio rapporto BM2 nr 46 del 25/05/2015
    Terminale: 002
    Codice tecnico: 02(Palmare02)

    Intervento eseguito presso:
    RA RAVENNA 48123
    In allegato è presente il rapporto nel formato PDF

    This is a PDF attachment encoded to base64
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="rap_BM2_46_20150525.pdf"

  2. Erel

    Erel Administrator Staff Member Licensed User

    This is the content type used for attachments. Have you tried it with a different mail client?
  3. cocale2001

    cocale2001 Member Licensed User

    The problem isalso another.Some server rejecting the message.
    Others accept the message but when I submit the attached message is unreadable.
    WhenI read the message save the attachmentto disk, and then I shall return then the attachment is fixed
    I'm confused ...
  4. giga

    giga Well-Known Member Licensed User

    "The problem isalso another.Some server rejecting the message"
    Are you receiving an actual rejection error message from the recipients server? if so what exactly does it say? Can you upload or paste the exact error?
  5. cocale2001

    cocale2001 Member Licensed User

    I can't see the smtp server log.Simply enter the email andt his is not received.
    This was the case with a popular Italian postal servers
    If there are not attachments that every thing works correctly
    I do not know what to do since the form b4a smtp does not provide any thing particular.
  6. giga

    giga Well-Known Member Licensed User

    "I can't see the smtp server log. Simply enter the email andt his is not received"
    (To My Knowledge) Most mail servers will send a rejection message back if a message is undeliverable.

    Here is what I would try.
    1. Use an email account that you have access to from a PC.
    2. Send the email message again using this account on the device.
    3. Then on the PC check the email for that account and see if you receive a "NDR"(Non-delivery return) for the message in question
    **NDR's can take up to 48hrs to return to you(based off the servers configuration)**

    That may give you more insight to what's happening.

    Unfortunately some mail servers may reject your message(s) based of their spam rules/settings. But again you should get a notice from the recipients server.

    Just like Snail Mail.

    **Now the downside, Some spam filtering programs can strip the attachment from the messages and let the message go through.
    example GFI Mail Essentials :( YOU have no control of this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice