Sending email from Mac desktop app

macOS Sonoma 14.7.5
Xojo 2025r1.1

I want to send emails with a PDF attached from my AOL account (or maybe my Gmail account at my curling club).
I have tried using both Xojo code only and Monkeybread plugin.
I have another program which sends similar emails through my tennis club’s web server account so I know it can be done.
Below is the code.
Socket1 is a SMTPSecureSocket with the Secure switch true. Out of desperation I tried all the SSL Connection Types and all the SMTP Connection Modes.
Anybody see the problem?

dim mail as EmailMessage
dim t as string

mail=new EmailMessage
// set up the socket
Socket1.Address = “smtp.aol.com
Socket1.Port = 465
Socket1.UserName = app.pDictEmail.Value(“YourEmail”)
Socket1.Password = app.pDictEmail.Value(“YourPassword”)

mail.FromAddress=app.pDictEmail.Value(“YourEmail”)
mail.AddRecipient(emailAdd)
for each em as string in gSendCopies
mail.AddCCRecipient(em)
next

mail.Subject=app.pDictIdentity.LookUp(“ClubName”,“Curling Club”)+" Ice Time Schedule Update"
t=“league ice time schedule”

mail.BodyPlainText=“This email contains the “+t+”. Open the attached PDF to see the details.”

dim attach as new EmailAttachment
attach.MIMEType=“application/pdf”
attach.LoadFromFile(file)

attach.name=“Ice Time Schedule Update.pdf”
mail.Attachments.Add(attach)

Socket1.Messages.Add(mail)
Socket1.SendMail

Do you have an app specific password for this?
Otherwise you could implement oauth.

Thanks for reply. But I don’t know why I need an app specific password.
I am using my AOL username and password. Why doesn’t that work?

App specific passwords are for older apps that cannot do all the fancy auth stuff. So they now offer the app specific password for older, simpler, apps.

I use Google for these occasions. No telling how long they will support it.