Problem with sending smtp Swift_message with Symfony2

Asked

Viewed 51 times

0

Hello, I have a problem when using SMTP with Swift_message.

I put the right information and the email arrives. The problem is that an email arrives for both "From" and "To". Is that normal or do I have to set something up so that it doesn’t happen?

I’ll put the code made with Symfony2 that, despite being a framework, you can understand what is being done.

$transport = \Swift_SmtpTransport::newInstance($host, $port, $security)
    ->setUsername($login)
    ->setPassword($senha)
    ->setAuthMode('login');

    $mailer = \Swift_Mailer::newInstance($transport);

    $message = \Swift_Message::newInstance()
        ->setSubject($titulo)
        ->setFrom($from)
        ->setTo($para)
        ->setBody(
            $conteudo,
            'text/html'
        );

    $mailer->send($message);
  • Is there any additional configuration you are doing on Swiftmailer other than the above code?

  • Unfortunately no, I just call these objects and if your values, also think that could be another setting in some other part of the application, but I’ve checked and there is no.

  • Do you know if there is something set up on the outgoing mail server to receive a copy of every email sent? I’m trying to find something in the documentation on Swiftmailer but I can’t find any problem similar to yours.

  • Well I’m using Digitalocean, I didn’t set up email server, I’m setting up my google account data, will google send email for security?

  • Supplement the question with the incoming email headers (open the incoming email, go to the options menu, and then go to "original show").

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.