All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Email Service - Send emails with named recipient addresses

1mo ago

Source

CloudflareEmail Service - Send emails with named recipient addressescloudflare.com
Snippet from the RSS feed
You can now send emails with display names on recipient addresses in addition to the existing from support. Pass an object with email and an optional name field for to , cc , bcc , replyTo , or from : JavaScript export default { async fetch ( request , env ) { const response = await env . EMAIL . send ( { from : { email : "[email protected]" , name : "Support Team" }, to : { email : "[email protected]" , name : "Jane Doe" }, cc : [ "[email protected]" , { email : "[email protected]" , name : "Engineering Team" }, ] , subject : "Welcome!" , html : "

Thanks for joining!

" , text : "Thanks for joining!" , } ) ; return Response . json ( { messageId : response . messageId } ) ; }, }; TypeScript export default { async fetch ( request , env ) : Promise < Response > { const response = await env . EMAIL . send ( { from : { email : "[email protected]" , name : "Support Team" }, to : { email : "[email protected]" , name : "Jane Doe" }, cc : [ "[email protected]" , { email : "[email protected]" , name : "Engineering Team" }, ] , subject : "Welcome!" , html : "

Thanks for joining!

" , text : "Thanks for joining!" , } ) ; return Response . json ( { messageId : response . messageId } ) ; }, } satisfies ExportedHandler < Env >; Plain strings remain fully supported for backward compatibility, and you can mix strings and named objects in the same array. Refer to the Workers API and REST API documentation for full request examples.

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.