/    Sign up×
Community /Pin to ProfileBookmark

Hello,

I am trying to send an email through php using the mail() function but getting the following error:

[code]Warning: mail() [function.mail]: SMTP server response: my-server-name-here [my-ip-address-here] is currently not 550-permitted to relay through this server. Perhaps you have not logged into 550-the pop/imap server in the last 30 minutes or do not have SMTP 550 Authentication turned on in your email client.[/code]

My PHP Code is:

[code]<?php
$to = ‘[email protected]’;
$subject = ‘the subject’;
$message = ‘hello’;
$headers = ‘From: [email protected]’ . “rn” .
‘Reply-To: [email protected]’ . “rn” .
‘X-Mailer: PHP/’ . phpversion();

mail($to, $subject, $message, $headers);
?>[/code]

FYI: I am running this code on windows 2003 server and i can send email using Horde.

What I am guessing is I need to add smtp authentication in my php code, so If you can tell me what is the syntax that can help me.

Does anyone know how to overcome this problem?

Thanx

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @phantom007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...