Share this page

# smtp_translate

Simple Mail Transfer Vuser Functions (SMTP)

Translates messages to SMTP protocol.

    int smtp_translate( char *filename, char *content_header, ENCODING_TYPE encoding, char *output_filename );

filename | The file to translate to SMTP protocol.
content_header | The content header`.`
encoding | The encoding method to use for translation. The following methods are available: 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 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 global sessions. For multiple sessions, use the smtp_translate_ex function, which allows you to specify a 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 function translates the file testfile.txt.

    smtp_translate("testfile.txt", "ABC",

        RAW_CONTENT, "outfile.txt");

    smtp_send_mail("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 Function Reference 26.1 All View Local Help Center View Online Help Center Version: