Jump to content

Recommended Posts

Hi,

 

I have contact form on my website, and I use SMTP php to send emails and my server instead of mail().function.

 

All works well, however. As it's sending the email. It keeps sending from my Gmail account to my Gmail account. 

Is there way  I can say in the code that "from" is from else where, but use gmail details to authenticate? 

$smtp = Mail::factory('smtp', array(
        'host' => 'ssl://smtp.gmail.com',
        'port' => '465',
        'auth' => true,
        'username' => 'myemail@gmail.com',
        'password' => 'supersecretpwrd'
    ));


$from = 'THE website@tosenditfrom.co.uk';
$to = 'myemail@gmail.com';
 $subject = "You don't want to know";   

Okay, I have that code. When I change the $from = it's still show from my email address.

 

Any suggestion?

With out making new email address 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/281463-smtp-email/
Share on other sites

I suggest you stop trying, basic spam filter checks include matching the senders (From) address to the domain that it was sent from, so sending a mail through yourname123@gmail.com and trying to masquerade as yourname@somedomain.com will, in most cases, get your message dumped before it gets where it wants to be.

Link to comment
https://forums.phpfreaks.com/topic/281463-smtp-email/#findComment-1446282
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.