| URI Parameter |
Required |
Requirements |
Description |
| to |
Yes |
Must be a valid email address |
This can also be passed in as an array, to send to multiple locations. Example: to[][email protected]&to[][email protected]. Note that recipients passed in this parameter will be visible as part of the message. If you wish to hide the recipients, use the TO parameter in the x-smtpapi header. |
| toname |
No |
Must be a string. If to parameter is an array, toname must be an array with the exact number of array elements as the to field |
Give a name to the recipient. This can also be passed as an array if the to above is an array. Example: toname[]=Alpha[]=Beta. |
| x-smtpapi |
No |
Must be in valid JSON format |
Please review the SMTP API to view documentation on what you can do with the JSON headers |
| subject |
Yes |
Must be a valid string |
The subject of your email |
| text |
No |
API call must include at least one of the text or html parameters. |
The plain text content of your email message. |
| html |
No |
API call must include at least one of the text or html parameters. |
The HTML content of your email message. |
| from |
Yes |
Must be a valid email address from your domain |
This is where the email will appear to originate from for your recipient |
| cc |
No |
Must be a valid email address |
This can also be passed in as an array of email addresses for multiple recipients. Example: cc[][email protected]&cc[][email protected]. |
| ccname |
No |
Must be a valid email address |
This is the name be appended to the cc field. |
| bcc |
No |
Must be a valid email address |
This can also be passed in as an array of email addresses for multiple recipients. Example: bcc[][email protected]&bcc[][email protected]. |
| bccname |
No |
Must be a valid email address |
This is the name appended to the bcc field. |
| fromname |
No |
Must a valid string |
This is the name appended to the from email field. IE - Your name or company name |
| replyto |
No |
Must be a valid email address |
Append a reply-to field to your email message |
| date |
No |
Must be a valid date |
Specify the date header of your email. One example: “Thu, 21 Dec 2000 16:01:07 +0200”. PHP developers can use: date(r); |
| files |
No |
Must be less than 7MB |
Files to be attached. The file contents must be part of the multipart HTTP POST. Ex: files[file1.jpg]=file1.jpg&files[file2.pdf]=file2.pdf |
| content |
No |
Required for sending inline images |
Content IDs of the files to be used as inline images. Content IDs should match the cids used in the HTML markup. Ex: content[file1.jpg]=ii_139db99fdb5c3704 would correspond with the HTML <img src="cid:ii_139db99fdb5c3704"></img> |
| headers |
No |
Must be in valid JSON format without integers |
A collection of key/value pairs in JSON format. This is specifically for non-SendGrid custom extension headers. Each key represents a header name and the value the header value. Ex: {"X-Accept-Language": "en", "X-Mailer": "MyApp"} |