Fax SMTP
This section provides a complete reference for developers wishing to use our fax service to send faxes automatically via SMTP.
The InterFAX fax SMTP service enables initiation of fax transmissions using SMTP, from email-enabled environments, without the need to install any hardware or software. Developers can use our fax SMTP service to send plain text messages and messages with attachments of various formats, such as HTML, Microsoft Word, PDF etc.
After initiating a fax transmission, status information regarding individual faxes sent can be obtained by a variety of means: by a return confirmation email, by querying the service through the InterFAX Web Service or by viewing the outbound fax queue through web-based user administration screens.
Requirements | Basic usage | Advanced usage | Getting status | Usage examples | Destination number notation rules | Error conditions
Requirements
In order for you to fax using SMTP with Interfax you must have: Email access over SMTP port 25.
Basic usage
This section explains the basic usage of our fax SMTP gateway for automatic faxing.
The minimal requirement for initiating a fax is sending an email with the following parameters. The resulting fax will be a plain-text document whose content is the email body.
| Field | Format | Comments |
|---|---|---|
| From | Email Address | This address is used for authentication; therefore, it must be an “allowed sender” address in an InterFAX account. This address will also be used as your fax identifier (CSID), i.e. this is what the recipient will see on the LCD screen of his fax machine.
PHP Developers note: When sending an email to fax from PHP it is not enough to set the “From:” address in PHP’s mail() command. You MUST set the sendmail_from address in PHP.INI to be the same as an allowed sender in your Interfax account (see https://www.sitepoint.com/article/679). |
| To | faxnumber@fax.tc | E.g., +12125558596@fax.tc. See Fax number formats. |
| Subject | String, max 60 characters | This string may be used for your reference and will appear in the reply email and in the web-based admin screen. |
| Body | String | This is the body of the fax. Text may be any length. Format may be plain text or HTML – if both are present, HTML will be faxed. |
Optional fields
| Field | Format | Comments |
|---|---|---|
| CC | Email Address |
Interfax will accept addresses entered into this field. |
| BCC | Email Address | Interfax will accept addresses entered into this field. |
| Reply-To | Email Address | Confirmations will be sent to this address (Default is to use the “From:” address). |
Advanced usage
This section explains how to perform advanced operations when sending faxes using our fax SMTP.
Advanced modifiers
Subject line modifiers | Sending attachments | Password authentication
Subject line modifiers
The following modifiers may be added to the end of the email’s Subject line to modify InterFAX’s behavior.
| Modifier | Description | Usage |
|---|---|---|
| /b | Attachment Indicator – Forces transmission of message body when both an attachment and an email body are present. The default behavior is set through account preferences. | [Subject] /b See Sending Attachments |
| /bn | Attachment Negative Indicator – Negates transmission of body when “Always include message body” is selected in account preferences. | [Subject] /bn |
| /bb | Send only email body – Suppresses transmission of any attachments. | [Subject] /bb |
| /ib | Specifies to include the background colors and images in an HTML document. | [Subject] /ib |
| /h | Header Indicator – Specifies to use a header in the outgoing fax. The header string follows (see account preferences for header string syntax). | [Subject] /h {header string} |
| /hn | Header Negative Indicator – Negates usage of a header in the outgoing fax when a fax header is defined in account preferences . | [Subject] /hn |
| /d | Defer transmission to a later time and (optionally) date Default: Send immediately |
[Subject] /d yyyy-mm-dd hh:mm |
| /fonttype | Specifies the font to be used in a text document. The list of acceptable fonts is visible in the account’s outgoing preferences. This setting has no effect on document types which internally indicate font types, such as Word and HTML. | [Subject] /fonttype {font name} |
| /fontsize | Specifies the font size to be used in a text document. This setting has no effect on document types which internally indicate font sizes, such as Word and HTML. | [Subject] /fontsize {font size} |
| /rs/rf |
Resolution – sets the rendering resolution of the document – standard or fine. Note: Do not use more than one of these modifiers at a time. |
[Subject] /rs[Subject] /rf |
| /gs/mono |
Rendering optimized for greyscale (gs) or monochrome (mono) Note: Do not use more than one of these modifiers at a time |
[Subject] /gs[Subject] /mono |
| /Landscape/Portrait |
Page Orientation for printing HTML/URL files, or other documents which do not include orientation. Note: Do not use more than one of these modifiers at a time |
[Subject] /Landscape[Subject] /Portrait |
| /A4/Letter/Legal/B4 |
Page size. Note: Do not use more than one of these modifiers at a time |
[Subject] /A4[Subject] /Letter[Subject] /Legal[Subject] /B4 |
| /at | Number of transmission attempts to perform, in case of fax transmission failure. Legal values: 1 – 10 Default: 4, or as defined in sending preferences |
[Subject] /at 5 will make up to 5 attempts |
| /rti | Minimum retry interval in minutes, i.e. the duration that the system will wait after a failed transmission attempt before performing a subsequent attempt. Legal values: 1 – 30 Default: 3, or as defined in sending preferences |
[Subject] /rti 2 will wait at least 2 minutes between attempts |
Note: Modifiers may be combined like:[Subject] /b /d 2002-01-01 18:01 /rs /Legal
Sending attachments
Several document attachments may be faxed in one message. The following table lists the resulting output, depending on usage of the /b and /bn modifiers.
| Email Contents | /b present | /b missing | “Always include message body” option selected, /bn present | “Always include message body” option selected, /bn missing |
|---|---|---|---|---|
| Message Body Only | Message Body | Message Body | Message Body | Message Body |
| Attachment Only | Attachment | Attachment | Attachment | Attachment and a blank page |
| Message Body and Attachment | Both | Attachment Only | Attachment Only | Both |
See Supported file types for information about supported attachment types.
Password authentication
Users who wish to apply an additional level of security to their faxing may elect to send their password with each outgoing email. This will offer another layer of identification in addition to the standard From header used by InterFAX to identify its users.
First, you will need to set this requirement in your user account. After logging in to your account, go to My Settings > Outgoing Options > Allowed Emails > Authentication. Check the Authenticate sender by password check box.
Now, each time you send an email, add your password somewhere in the message body in the following format: !#password. For example, !#123452.
This entry will be automatically stripped from the outgoing fax. Should the password be missing or incorrect – the fax will not be sent.
Getting status
This page explains how to view the status of faxes sent via our SMTP fax interface. The email interface does not directly enable viewing the status of your outgoing fax queue. However, a variety of methods exists to enable confirmation of faxing activity.
Web-based account management
Your SMTP faxing activity, whether initiated from a programmatic email interface, from the Interfax Web Service, or any other way, will always be visible by logging into your account.
After logging in, go to Outbound Faxes to view all of your outbound faxes.
Confirmation email
You may elect to receive a confirmation email to report the completion of outgoing faxes. You may indicate which events will trigger such notification: On Success Only, On Failure Only, Always, or Never.
Configuration of this setting is performed through your account. After logging in, go to the Notifications tab in Outbound settings and choose an option for Delivery Status via Email.
The format of the confirmation email can be one of several options. See Fax feedback formats for more information.
Note: If you send SMTP faxes to several destinations at once, by entering more than one address into the “To:” field, you will not receive confirmations for every single recipient. Instead, you will receive a single email, detailing the outcome of transmission to all destinations. The email will be sent upon completion of all transmissions.
InterFAX web service
The InterFAX Web Service may be used to programatically retrieve information about outgoing faxes. See Outbound fax web service for more information.
Usage examples
This section provides usage examples for developers wishing to use our fax SMTP interface to send faxes automatically.
The email message may be generated from any environment that can send a standard SMTP email. The following examples show syntax and required fields for the most popular SMTP fax scenarios.
Email body only
Below is a code sample showing how to send a fax using the SMTP interface, inserting the content of the fax message into the SMTP body.
From: sender@sendaddress.com
To: +1(212)555-9999@fax.tc
Subject: Here's a test fax
Message: Here comes a long message. If there is no file attachment, the message body is sent.
Attachment only
Below is a code sample showing how to send a fax using the SMTP interface, by adding the fax content as an attachment, and instructing the system to ignore the email body.
From: sender@sendaddress.com
To: +1(212)555-9999@fax.tc
Subject: Here's a test fax
Attachment: Quotation.doc
Message: This message will be ignored and only the attachment will be sent because there is no /b modifier at the end of the subject line.
Email body and attachment
Below is a code sample showing how to send a fax using the SMTP interface, by adding an attachment, and instructing the system to send both the SMTP body and the attachment in the fax message.
From: sender@sendaddress.com
To: +1(212)555-9999@fax.tc
Subject: Here's a test fax /b
Attachment: Quotation.doc
Message: In this case both this message body AND the attachment will be faxed because there is a /b modifier at the end of the subject line.
Deferred transmission
This is a code sample showing how to send an SMTP fax at a future time.
From: sender@sendaddress.com
To: +1(212)555-9999@fax.tc
Subject: Here's a test fax /d 2002-12-31 00:45
Message: In this case the message will be faxed at a later time. The /d modifier works with the following date format: yyyy-mm-dd hh:mm. If no date is entered, the current date is assumed.
Destination number notation rules
See Fax number formats for more information.
Error conditions
This page explains how to deal with errors received when sending faxes automatically using our fax SMTP gateway.
The InterFAX service is a hybrid mail/fax server and will issue error messages within the SMTP communication stream, where possible. This provides a standard error-notification mechanism which captures errors, such as unidentified senders or malformed destination addresses, which may be returned immediately to the sender encapsulated as an email error condition.
For a definition of error codes see Fax status codes.