SmtpClient: An extension to send emails using SMTP server

Hi, @vknow360

When trying to send contents with Chinese.

I send successfully, but I got this:

the subject is good, but the body became ????

Can you advise how to avoid this?
Thanks.

What happens when you encode the Chinese characters using the Web. UriEncode block, then passing it to the extension?

tested,

got this:
image

You have to use Encode block but you used Decode block. Please try encoding content.

Sorry my bad.

Still not working, both Encode and Decode

Here is a small update.
com.sunny.SmtpClient.aix (959.4 KB)

You needn't encode content now.

1 Like

i created app passwords..and secure the activity..btw what's the problem??

edit: Solved

How can we send this kind of email(body) though this extension??

feed the body socket with HTML text, and isHTML is true.

How to write the HTML? Just google it, there are a lot of tutorials.

3 Likes

Hi the code is working great without the image but with an attachment it gives me error "IOException while sending message".
Could somebody help?
Pls reply ASAP if possible as I have a school project deadline with 2hrs.

Show your relevant blocks

I assume this is what u want?
the code works like this however when i use an attachment i get the error"IOException while sending message"(sending code with attachment shortly)

Im using Camera instead of Image Picker


showing as label5 might be important


the code with the attachment

attachment is expecting a file, not a string.

If you want to include the contents of your label, add it to the body of your email message.

setting Label5 to image in the AfterPicture event should give you the filepath to the image.

do u mean the do it result?

im getting Do It Result: "file:///storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/Pictures/app_inventor_1682348329907.jpg"

what should i do with this?
since the file will be diffrent everytime will u not need to input the do it differently?
im new so im asking

maybe the attachment need a absolute path. try to remove file://

Thank u so much Kevinkun for ur help. Resolved the issue.

when doing this it required me to input the variable, thus giving it a weird path.(I did not know how to utilize it)
Nevertheless, Thank u so much for your help.