@@ -47,26 +47,28 @@ protected function createSmtpDriver()
47
47
$ transport ->setPassword ($ config ['password ' ]);
48
48
}
49
49
50
- // Next we will set any stream context options specified for the transport
51
- // and then return it. The option is not required any may not be inside
52
- // the configuration array at all so we'll verify that before adding.
50
+ return $ this ->configureSmtpDriver ($ transport , $ config );
51
+ }
52
+
53
+ /**
54
+ * Configure the additional SMTP driver options.
55
+ *
56
+ * @param \Swift_SmtpTransport $transport
57
+ * @param array $config
58
+ * @return \Swift_SmtpTransport
59
+ */
60
+ protected function configureSmtpDriver ($ transport , $ config )
61
+ {
53
62
if (isset ($ config ['stream ' ])) {
54
63
$ transport ->setStreamOptions ($ config ['stream ' ]);
55
64
}
56
-
57
- // Set the source ip for servers which have more than one ip address.
58
- // This will cause Swift SMTP transport to make requests only via that
59
- // IP address, which is useful for firewalled smtp servers like gmail
60
- // smtp relay.
61
- if (isset ($ config ['sourceip ' ])) {
62
- $ transport ->setSourceIp ($ config ['sourceip ' ]);
65
+
66
+ if (isset ($ config ['source_ip ' ])) {
67
+ $ transport ->setSourceIp ($ config ['source_ip ' ]);
63
68
}
64
-
65
- // Allow setting the local domain which Swift SMTP transport will use
66
- // to identify the request domain to the smtp server, which is useful
67
- // for shared smtp servers like gmail's smtp relay.
68
- if (isset ($ config ['localdomain ' ])) {
69
- $ transport ->setLocalDomain ($ config ['localdomain ' ]);
69
+
70
+ if (isset ($ config ['local_domain ' ])) {
71
+ $ transport ->setLocalDomain ($ config ['local_domain ' ]);
70
72
}
71
73
72
74
return $ transport ;
0 commit comments