CreateEmailDC method (IEPrint)

Visual Basic example

Visual C++ example

 

Syntax

long CreateEmailDC(BSTR pszPrinterName, IEpnDeviceSettings *pDeviceSettings, IEpnMailMessageInfo * pMailMessageInfo, IEpnPrinterSaveOptions *pPrinterSaveOptions, IEpnExtraDcOptions* pExtraOptions);

Overview

Refer to Redirecting to Send an Email

Remarks

Creates an e-mail redirection device context (DC).

Support for Basic functionality must be unlocked by calling the UnlockSupport method before using this method.

The created DC can be used as an ordinary printer DC. Each GDI command executed for this DC will be saved as a file using the file save options pointed to by the pSaveOptions parameter. These files will be attached to an email message and sent to the mail recipient(s) using the options pointed to by pMailMessageInfo parameter.

Before using the created DC, the user should call the StartDoc and StartPage methods. After using the created DC the user should call the EndPage and EndDoc methods.

When the created DC is no longer needed, it should be deleted by calling DeleteDC method. For every DC created using CreateEmailDC there must be a call to DeleteDC to free it.

If the mail configuration settings for a specific printer were not set, then the user should set these using the SetPrinterEmailConfiguration method before calling the CreateEmailDC method.

For OEM Printers:

If the OEM printer is locked, then the user can use it indirectly by using this method.

To use the locked OEM printer indirectly, pass a valid data to the pExtraOptions parameter. Please note that the value of the Password property (IEpnExtraDcOptions) must be set by the administration password that was used when the OEM printer was installed by calling the InstallOEMPrinter method.

If the printer is locked and either NULL or an invalid password is supplied in pExtraOptions, the CreateEmailDC method will fail and return 0.

For more information, refer to Locking and Unlocking the OEM ePrint Printer.

See Also

Elements:

LockOEMPrinter method, UnlockOEMPrinter method, UnlockSupport method, InstallOEMPrinter method, UninstallOEMPrinter method, Password property, CreateSaveDC method, CreateRedirectionDC method, DeleteDC method

Topics:

ePrint: Printing indirectly to OEM Printers