Skip to main content
POST
/
v1
/
email
/
send
Send Email with File
curl --request POST \
  --url https://api.pdf.co/v1/email/send \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "url": "<string>",
  "from": "John Doe <john@example.com>",
  "to": "Partner <partner@example.com>",
  "replyto": "<string>",
  "cc": "<string>",
  "bcc": "<string>",
  "subject": "Check attached sample pdf",
  "bodytext": "Please check the attached pdf",
  "bodyhtml": "Please check the attached pdf",
  "smtpserver": "smtp.gmail.com",
  "smtpport": "587",
  "smtpusername": "my@gmail.com",
  "smtppassword": "app specific password created as https://support.google.com/accounts/answer/185833",
  "name": "<string>",
  "async": true,
  "expiration": 60,
  "profiles": "<string>",
  "httpusername": "<string>",
  "httppassword": "<string>"
}'

Authorizations

x-api-key
string
header
required

Body

application/json
url
string<uri>
default:https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-info/sample.pdf
required

URL to the source file url attribute.

from
string
default:John Doe <john@example.com>
required
to
string
default:Partner <partner@example.com>
required
subject
string
default:Check attached sample pdf
required
smtpserver
string
default:smtp.gmail.com
required
smtpusername
string
default:my@gmail.com
required
smtppassword
string
default:app specific password created as https://support.google.com/accounts/answer/185833
required
replyto
string
cc
string
bcc
string
bodytext
string
default:Please check the attached pdf
bodyhtml
string
default:Please check the attached pdf
smtpport
string
default:587
name
string

File name for generated output.

async
boolean
default:false

Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks

expiration
number
default:60

Sets the expiration time for the output link, in minutes. After this period, generated output file(s) are automatically deleted from PDF.co Temporary Files Storage. The maximum allowed duration depends on your subscription plan. For permanent storage of input files (e.g., reusable images, PDF templates, documents), use PDF.co Built‑In Files Storage.

profiles
string

Profiles are used configure extra options for specific API endpoints and may be unique to an API. For more information, see Profiles and the documentation of each endpoint for profiles specific to it.

httpusername
string

HTTP auth user name if required to access source URL.

httppassword
string

HTTP auth password if required to access source URL.