Laysan Martin,
To work with Gmail, you need to enable SSL. For this, if you use 1C:Small Business 1.4.7, please change the GenerateInternetProfile() function of the Email common module to the following:
Code |
---|
Function GenerateInternetProfile(Val UserAccount,
Val Password = Undefined,
Val GenerateSMTPProfile = True,
Val GeneratePOP3Profile = True) Export
ConnectionSettings = CommonUse.ObjectAttributesValues(
UserAccount,
"User,
|Password,
|Timeout,
|SMTPServer,
|SMTPPort,
|SMTPAuthentication,
|SMTPAuthenticationMode,
|SMTPUser,
|SMTPPassword,
|POP3Server,
|POP3Port,
|POP3AuthenticationMode");
Profile = New InternetMailProfile;
Profile.User = ConnectionSettings.User;
Profile.Timeout = ConnectionSettings.Timeout;
If ValueIsFilled(Password) Then
Profile.Password = Password;
Else
Profile.Password = ConnectionSettings.Password;
EndIf;
If GenerateSMTPProfile Then
Profile.SMTPServerAddress = ConnectionSettings.SMTPServer;
Profile.SMTPPort = ConnectionSettings.SMTPPort;
If ConnectionSettings.SMTPAuthentication = Enums.SMTPAuthenticationOptions.SimilarlyPOP3 Then
Profile.SMTPAuthentication = SMTPAuthenticationMode.Default;
Profile.SMTPUser = ConnectionSettings.User;
Profile.SMTPPassword = Profile.Password;
ElsIf ConnectionSettings.SMTPAuthentication = Enums.SMTPAuthenticationOptions.DefinedByParameters Then
If ConnectionSettings.SMTPAuthenticationMode = Enums.SMTPAuthenticationMethods.CramMD5 Then
Profile.SMTPAuthentication = SMTPAuthenticationMode.CramMD5;
ElsIf ConnectionSettings.SMTPAuthenticationMode = Enums.SMTPAuthenticationMethods.Login Then
Profile.SMTPAuthentication = SMTPAuthenticationMode.Login;
ElsIf ConnectionSettings.SMTPAuthenticationMode = Enums.SMTPAuthenticationMethods.Plain Then
Profile.SMTPAuthentication = SMTPAuthenticationMode.Plain;
ElsIf ConnectionSettings.SMTPAuthenticationMode = Enums.SMTPAuthenticationMethods.WithoutAuthentication Then
Profile.SMTPAuthentication = SMTPAuthenticationMode.None;
Else
Profile.SMTPAuthentication = SMTPAuthenticationMode.Default;
EndIf;
Profile.SMTPUser = ConnectionSettings.SMTPUser;
Profile.SMTPPassword = ConnectionSettings.SMTPPassword;
ElsIf ConnectionSettings.SMTPAuthentication = Enums.SMTPAuthenticationOptions.POP3BeforeSMTP Then
Profile.SMTPAuthentication = SMTPAuthenticationMode.None;
Profile.POP3BeforeSMTP = True;
Else
Profile.SMTPAuthentication = SMTPAuthenticationMode.None;
EndIf;
Profile.SMTPUseSSL = True;
EndIf;
If GeneratePOP3Profile Then
Profile.POP3ServerAddress = ConnectionSettings.POP3Server;
Profile.POP3Port = ConnectionSettings.POP3Port;
If ConnectionSettings.POP3AuthenticationMode = Enums.POP3AuthenticationMethods.APOP Then
Profile.POP3Authentication = POP3AuthenticationMode.APOP;
ElsIf ConnectionSettings.POP3AuthenticationMode = Enums.POP3AuthenticationMethods.CramMD5 Then
Profile.POP3Authentication = POP3AuthenticationMode.CramMD5;
Else
Profile.POP3Authentication = POP3AuthenticationMode.General;
EndIf;
Profile.POP3UseSSL = True;
EndIf;
Return Profile;
EndFunction |
You also should use other ports and enable using your account from email applications, not from browser. And sometimes Gmail blocks using it from unknown places.