שמירת שאילתא באקסס
-
תחליף את הפונקציה האחרונה במודול שלך (Send) לזה:
Public Function Send(strBodyText) as string 'on error goto SendErr Dim cdoConfig Dim msgOne Dim ErrStr Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 465 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "YourEmail@gmail.com" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "YourPasswoed" .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Update End With Set msgOne = CreateObject("CDO.Message") Set msgOne.Configuration = cdoConfig msgOne.To = "To name <SendTo@gmail.com>" msgOne.From = "Your Name <YourEmail@gmail.com>" msgOne.Subject = "בוצע חיפוש" msgOne.TextBody = strBodyText msgOne.Send send = "השליחה בוצעה בהצלחה" exit function SendErr: send = "התרחשה שגיאה במהלך שליחת המייל" End Function