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

To be able to sent both HTML and text emails using net.smtp (multipart/alternative Content-Type) #23288

Open
2 tasks
khalyomede opened this issue Dec 27, 2024 · 0 comments

Comments

@khalyomede
Copy link
Contributor

khalyomede commented Dec 27, 2024

Describe the feature

To be able to send both text and HTML emails as part of a single sending.

Use Case

Some spam filters may consider emails as SPAM if it omit a text alternative. Having a text alternative as well as HTML is also a good accessibility practice as some email client can display a simplified version of a mail if the user needs it.

Proposed Solution

// If html and text are not set, use body/body_type/attachments instead

mail := net.smtp.Mail{
  // ...
  html: net.smtp.Message{
    body: "<h1>Welcome!</h1><p>Your account has been created.</p>"
    attachments: []
  }
  text: net.smtp.Message{
    body: "Welcome! Your account has been created."
    attachments: []
  }
}

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

0.4.7

Environment details (OS name and version, etc.)

V full version: V 0.4.7 e03bd3f
OS: linux, Linux version 6.8.0-49-generic (buildd@lcy02-amd64-103) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu122.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #4922.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz

getwd: /home/v
vexe: /opt/vlang/v
vexe mtime: 2024-09-26 07:47:51

vroot: OK, value: /opt/vlang
VMODULES: OK, value: /root/.vmodules
VTMP: OK, value: /tmp/v_0

env VFLAGS: "-cc gcc"

Git version: git version 2.40.3
Git vroot status: e03bd3f (708 commit(s) behind V master)
.git/config present: true

CC version: cc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924
thirdparty/tcc status: thirdparty-linuxmusl-amd64 a3e24da

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

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

No branches or pull requests

1 participant