Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 24, 2024

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Jan 23, 2024

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

@spytheman spytheman merged commit 4163faf into vlang:master Jan 24, 2024
42 checks passed
@shove70 shove70 deleted the attachments branch January 24, 2024 05:50
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