Hello , I need help . I need to choose an image from the gallery , but achieves select the DIR and filename does not work or is not the right to attach it to an email. as I have to do ?
part of code.
When you send email , it indicates that you can not attach an empty file
part of code.
When you send email , it indicates that you can not attach an empty file
B4X:
sub globals
Dim filename1 As String
Dim dir1 As String
Dim Galeria As ContentChooser
end sub
Sub Botfoto_Click
Galeria.Initialize("galeria")
Galeria.Show("image/*","Seleccione Imagen:")
End Sub
Sub Galeria_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
Msgbox(FileName,"") ' Directorio de la imagen
Msgbox(Dir,"") ' Nombre del fichero
filename1 = fileName
dir1 = Dir
Else
Return
End If
End Sub
Sub enviar_mail ()
Dim mensaje As Email
mensaje.To.Add("[email protected]")
mensaje.Subject =evento_electrico & evento_informacion & evento_telefonico & evento_internet & " " & Editsuministro.Text
mensaje.Body = Editobs.Text
If File.Exists(dir1,filename1) = True Then
mensaje.Attachments.Add(filename1)
End If
StartActivity(mensaje.GetIntent)
End Sub