Jump to content

SMTP Email


Asmondien

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
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.