nette / mail

A handy library for creating and sending emails in PHP
https://doc.nette.org/mailing
Other
469 stars 71 forks source link

mail twice #48

Closed theone-daxia closed 6 years ago

theone-daxia commented 6 years ago

Description

after required this composer, every time i send email to me, i will receive email twice! why?

Steps To Reproduce

... If possible a minimal demo of the problem ...

milo commented 6 years ago

I'm sorry, but probably our english is not compatible and maybe I don't undestand well.

You cannot receive email when you required this package by Composer only. You have to use some code to send mail. Send an example of code here and the package version.

theone-daxia commented 6 years ago

`<?php

use Nette\Mail\Message; use Nette\Mail\SendmailMailer;

class Mail extends Message { public static function sendEmailToMe() { $mail = new Message; $mail->setFrom('haha@.com.cn') ->addTo('haha@.com.cn') ->setSubject('surprise') ->setBody('hello daxia'); $mailer = new SendmailMailer; $mailer->send($mail); } }`

this is my code, i execute it , i will receive two same email from apache

k00ni commented 6 years ago

Hi, how and when do you call sendMailToMe? Maybe the function itself gets called twice?

dg commented 6 years ago

Imho problem is not in this library.