Skip to content

smtp: Implement smtp mail attachment support(fix #19920) - #20640

Merged
spytheman merged 1 commit into
vlang:masterfrom
shove70:attachments
Jan 24, 2024
Merged

spytheman merged 1 commit into
vlang:masterfrom
shove70:attachments

Conversation

@shove70

@shove70 shove70 commented Jan 23, 2024 •

Copy link
Copy Markdown
Contributor

This PR: Implement smtp mail attachment support.
Close #19920

send_cfg := smtp.Mail{
		from: '${nicename}<${sender}>'
		to: receivers
		subject: subject
		body_type: smtp.BodyType.html
		body: body
		attachments: [
			smtp.Attachment {
				filename: 'readme.txt'
				bytes: '...Some file content...'.bytes()
			}
		]
	}

	mut client := smtp.new_client(client_cfg)!
	client.send(send_cfg)!
	client.quit()!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attachments in net.smtp.Mail

2 participants