T Tata Mapassa Active Member Licensed User Longtime User Nov 10, 2024 #1 Hello, how to send an email to all email addresses in the Mail field of the T_contact table. Thank
teddybear Well-Known Member Licensed User Nov 11, 2024 #3 Tata Mapassa said: Hello, how to send an email to all email addresses in the Mail field of the T_contact table. Thank Click to expand... Do you mean the smtp.to.addall(mailaddresslist)? Upvote 0
Tata Mapassa said: Hello, how to send an email to all email addresses in the Mail field of the T_contact table. Thank Click to expand... Do you mean the smtp.to.addall(mailaddresslist)?
T Tata Mapassa Active Member Licensed User Longtime User Nov 11, 2024 #4 Yes, create a list with all the email addresses from the Mail field of the T_contact table. Thank you Upvote 0
Yes, create a list with all the email addresses from the Mail field of the T_contact table. Thank you
aeric Expert Licensed User Longtime User Nov 11, 2024 #5 You need to read the database using SQL then add the item into a list. Upvote 0
T Tata Mapassa Active Member Licensed User Longtime User Nov 11, 2024 #6 below is the code I use to retrieve the emails but using the list as the recipient of the email crashes Dim ListMail As List ListMail.Initialize Dim Cursor As Cursor Cursor = SQL1.ExecQuery("SELECT Mail FROM Table") For i = 0 To Cursor.RowCount - 1 Cursor.Position = i ListMail.Add(Cursor.GetString("Mail")) Next Cursor.Close SQL1.Close Try Dim email As Email email.To.AddAll(Array As String(ListMail)) email.Subject = "" email.body ="" Dim in As Intent = email.GetIntent in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION StartActivity(in) Catch Log(LastException) End Try Upvote 0
below is the code I use to retrieve the emails but using the list as the recipient of the email crashes Dim ListMail As List ListMail.Initialize Dim Cursor As Cursor Cursor = SQL1.ExecQuery("SELECT Mail FROM Table") For i = 0 To Cursor.RowCount - 1 Cursor.Position = i ListMail.Add(Cursor.GetString("Mail")) Next Cursor.Close SQL1.Close Try Dim email As Email email.To.AddAll(Array As String(ListMail)) email.Subject = "" email.body ="" Dim in As Intent = email.GetIntent in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION StartActivity(in) Catch Log(LastException) End Try
teddybear Well-Known Member Licensed User Nov 12, 2024 #7 Please use [code]code here...[/code] tags when posting code. B4X: 'email.To.AddAll(Array As String(ListMail)) 'The parameter just is list not need to convert it to Array email.To.AddAll(ListMail) Upvote 0
Please use [code]code here...[/code] tags when posting code. B4X: 'email.To.AddAll(Array As String(ListMail)) 'The parameter just is list not need to convert it to Array email.To.AddAll(ListMail)