Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a rare situation you have here... if you do not have a mail server you can still tell PHPMailer to send from a different address just set the <code>From</code> attribute of the <code>PHPMailer</code> object to the address you want. But Wait! if your server doesn't exists, the client can't verify the account and then your mail will more likely be deleted (moved to spam in the more benevolent scenario). If you are trying to mimic third party mail, I'll help you no futher.</p> <p><strong>Note</strong>: Your mail server may be valid but clients are still unable to verify it, and thus you are getting mails delivered to spam or deleted, to have some inside to solve this... check below in "Must Read".</p> <p>On the other hand, if you already have a mail server, then tell PHPMailer you want to use it, set the <code>Host</code> and <code>Port</code> attributes to your domain name and port receptively. The same if you want to use an account form a different server, remember to set the attributes <code>Username</code> and <code>Password</code> correctly, you may also need to set <code>SMTPAuth = true;</code> and <code>SMTPSecure = 'ssl';</code> depending on the server. [Note: <code>Username</code> and <code>From</code> may differ]</p> <p>Now if you want to use an account from Gmail, you could easily set an alias in Gmail to send as another account [Go to Settings-> Accounts And Import -> Send mail as -> (click) Send Mail From Another Address], that can be the case if you have a mail server but you cannot afford to have it online, you will need to start your server so you can receive the confirmation code Gmail generates to verify your account. Check recommended read for PHP side configuration detail.</p> <p>Lastly if for some rare circunstancies you can't tell PHPMailer to use your mail server, but you do in fact have one, and that one is able to recieve the mail... you can use <code>AddReplyTo('me@mymailserver.com', 'My Name');</code> Most clients will understand that any reply to the message must be (unless explicitly defined by the user) directed to "me@mymailserver.com" in this case.</p> <p><strong>Disclaimer 1</strong>: I have no relationship with mymailserver.com, any match with an actual domain name is not intentional and merely coincidental.</p> <p><strong>Disclaimer 2</strong>: I take no responsibility of any harm result of the use of the method I mention here, such as (but not limited to) your mail account getting banned.</p> <p><strong>Must read</strong>: [Coding Horror on sending mail via code] <a href="http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html" rel="nofollow">http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html</a></p> <p><strong>Recommended read</strong>:</p> <p><strike>[PHPMailer Tutorial] <a href="http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html" rel="nofollow">http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html</a></strike></p> <p>[PHPMailer Tutorial] <a href="http://web.archive.org/web/20100819041054/http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html" rel="nofollow">http://web.archive.org/web/20100819041054/http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html</a></p> <p>[PHPMailer and Gmail] <a href="http://mediakey.dk/~cc/send-email-using-php-phpmailer-and-gmail/" rel="nofollow">http://mediakey.dk/~cc/send-email-using-php-phpmailer-and-gmail/</a></p> <p>No need (neither a good way) to hide or mask whatsoever.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload