Share this page

# smtp_translate_ex

Simple Mail Transfer Vuser Functions (SMTP)

Translates messages to SMTP protocol for a specific session.

    int smtp_translate_ex( SMTP *ppsmtp,char *filename, char *content_header, ENCODING_TYPE encoding, char *output_filename );

ppsmtp | A session identifier.
filename | The file to translate to SMTP protocol.
content_header | The content header.
encoding | The encoding method to use for translation. UNKNOWN_ENCODING – Unknown (AutoDetect) ASCII_7BIT – 7–bit QUOTED_PRINTABLE –quoted–printable characters. BASE64_ENCODED– base 64 RAW_CONTENT – Send file as is. The file must have its own header
output_filename | The name of the file containing the translated message.

The smtp_translate_ex function translates messages for SMTP server. You specify the source and target files, the content header and the encoding type.

This function is for use with multiple sessions. For global sessions, use the smtp_translate function, which leaves out the session identifier.

## Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.

## Parameterization

All arguments of this function of the type char, can be parameterized with standard parameterization.

## Example

In the following example, the smtp_translate_ex function translates a file into SMTP protocol.

Copy code

    smtp_translate_ex(&ppsmtp, "testfile.txt",
        "ABC", RAW_CONTENT, "outfile.txt");
    smtp_send_mail_ex(&ppsmtp, "SendMail",
        "To=henry_tilden@northander_abbey.com",
        "Subject=In defense of novels",
        MAILOPTIONS,
            "X–Priority: 3",
            "X–MSMail–Priority: Normal",
            "X–Mailer: Microsoft Outlook Express 5.00.2919.6700",
            "X–MieOLE: Produced By Microsoft MimeOLE V5.00.2919.6700",
        MAILDATA,
            "AttachRawFile=outfile.txt",
        LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: